看不出来啊
#include <stdio.h>
int main()
{
/* 定义需要计算的日期 */
int year = 2008;
int month = 8;
int day = 8;
int sum,flag;
switch(month)
{
case 1:day += 31;
case 2:
if(year%4 == 0 && year %100 != 0 || year%400 == 0)
{
day += 29;
}
else
{
day += 28;
}
case 3:day += 31;
case 4:day += 30;
case 5:day += 31;
case 6:day += 30;
case 7:day += 31;
case 8:day += 31;
case 9:day += 30;
case 10:day += 31;
case 11:day += 30;
case 12:day += 31;
default:printf("一年只有12个月哦~");break;
}
sum=sum+day;
sum++;
printf("%d年%d月%d日是改年的第%d天"year,month,day,sum);
return 0;
}