#include <stdio.h>
int main()
{
int year = 2008;
int month =1;
int day = 8;
int date;
switch(month)
{
case 1:date+=0;
case 2:date+=31;
case 3:date+=28;
case 4:date+=31;
case 5:date+=30;
case 6:date+=31;
case 7:date+=30;
case 8:date+=31;
case 9:date+=31;
case 10:date+=30;
case 11:date+=31;
case 12:date+=day;
break;
}
if(year%400==0||(year%4==0&&year%100!=00))
date=date+1+day;
else
date=date+day;
printf("%d年是%d月%d日是该年的第%d天 ",year,month,day,date);
return 0;
}
我输出的时候那个日期总是错误显示-837847982478一类的
聊发少年狂
望远
一叶追寻
慕容5123895