求解:这样有错误吗
#include <stdio.h>
int main()
{
/* 定义需要计算的日期 */
int year = 2008;
int month = 8;
int day = 8;
int sum;
switch(month)
{
case 1:sum=day;break;
case 2:sum=day+31;break;
case 3:sum=day+60;break;
case 4:sum=day+91;break;
case 5:sum=day+121;break;
case 6:sum=day+152;break;
case 7:sum=day+182;break;
case 8:sum=day+213;break;
case 9:sum=day+244;break;
case 10:sum=day+274;break;
case 11:sum=day+305;break;
case 12:sum=day+335;break;
default:printf("一年只有12个月");break;
}
if((year%4==0&&year%100!=0)||year%400==0)
{sum=sum;}
else
{sum=sum-1;}
printf("%d年%d月%d日是该年中的第%d天\n",year,month,day,sum);
return 0;
}