我的运行成功了,结果也是对的,但是显示我的输出错误,为什么?
#include <stdio.h>
int main()
{
/* 定义需要计算的日期 */
int year = 2008;
int month = 8;
int day = 8;
switch(month)
{
case 1:
day+=0;break;
case 2:
day+=31;break;
case 3:
day+=59;break;
case 4:
day+=90;break;
case 5:
day+=120;break;
case 6:
day+=151;break;
case 7:
day+=181;break;
case 8:
day+=212;break;
case 9:
day+=243;break;
case 10:
day+=273;break;
case 11:
day+=304;break;
case 12:
day+=334;break;
}
if(year%100==0&&year%400==0||year%4==0&&year%100!=0)
day+=1;
else
day+=0;
printf("第%d天",day);
return 0;
}