各位大佬请问哪里错了?找不出来
#include <stdio.h>
int main()
{
int year = 2008;
int month = 8;
int day = 8;
int sum=0;
if(year%4==0)
{
for(int month=1;month<=7;month++)
{
switch(month)
case 1:sum+=31;
break;
case 2:sum+=29;
break;
case 3:sum+=31;
break;
case 4:sum+=30;
break;
case 5:sum+=31;
break;
case 6:sum+=30;
break;
case 7:sum+=31;
break;
}
}
else(year%4!=0)
{
for(int month=1;month<=7;month++)
{
switch(month)
case 1:sum+=31;
break;
case 2:sum+=28;
break;
case 3:sum+=31;
break;
case 4:sum+=30;
break;
case 5:sum+=31;
break;
case 6:sum+=30;
break;
case 7:sum+=31;
break;
}
}
sum+=day;
printf("2008年8月8日是该年的第%d天",sum);
return 0;
}