4-17 语句应用我的程序少了六十天
int i=0;
int sum=0;
switch(month)
{
case 1: i=0;
case 2:i=i+31;
case 3:
if((year%400==0)||(year%4==0&&year%100!=0))
{ i=i+29;}
else
{ i=i+28;}
case 4:i=i+31;
case 5:i=i+30;
case 6:i=i+31;
case 7:i=i+30;
case 8:i=i+31;
case 9:i=i+31;
case 10:i=i+30;
case 11:i=i+31;
case 12:i=i+30; break;}
sum=i+day;
printf("2008年8月8日是该年中的第%d天\n",sum);
return 0;
}
求大神教我哪错了,总是161天,少了六十天,怀疑一月二月没算上!