main()
{
int year,month,day,s;
int X;
printf("input the year,the month,the day :");
scanf("%d%d%d",&year,&month,&day);
switch(month)
{
case 1: s=0;break ;
case 2: s=31;break ;
case 3: s=59;break ;
case 4: s=90;break ;
case 5: s=120;break ;
case 6: s=151;break ;
case 7: s=181;break ;
case 8: s=212;break ;
case 9: s=243;break ;
case 10: s=273;break ;
case 11: s=304;break ;
case 12: s=334;break ;
default:printf("error input!");
}
if (year%4!=0) X=s+day;
else if(year%100=0&&year%400!=0)
X=s+day;
else X=s+day+1;
printf("result=%d\n",X);
return 0;
}
还没写完,但为什么提示”left operand must be l-value“啊!