只是出来结果220
#include <stdio.h>
int main()
{
/* 定义需要计算的日期 */
int year = 2008;
int month = 8;
int day = 8;
int i,j;
switch(month)
{
case 1:j=0;break;
case 2:j=30;break;
case 3:j=30+28;break;
case 4:j=30+28+31;break;
case 5:j=30+28+31+30;break;
case 6:j=30+28+31+30+31;break;
case 7:j=30+28+31+30+31+30;break;
case 8:j=30+28+31+30+31+30+31;break;
case 9:j=30+28+31+30+31+30+31+31;break;
case 10:j=30+28+31+30+31+30+31+31+30;break;
case 11:j=30+28+31+30+31+30+31+31+30+31;break;
case 12:j=30+28+31+30+31+30+31+31+30+31+30;break;
}
if(year%4==0&&year%100!=0||year%400==0)
{
day=j+day+1;
printf("%d",day);
}
else
{
day=j+day;
printf("%d",day);
}
return 0;
}