各位大神,看看这个程序有什么不对?
#include <stdio.h>
int main()
{
/* 定义需要计算的日期 */
int year = 2008;
int month = 8;
month=month-1;
int day = 8;
int k;
switch(month)
case 1: k=31;
break;
case 2: k=28+31;
break;
case 3: k=31+28+31;
break;
case 4: k=30+31+28+31;
break;
case 5: k=31+30+31+28+31;
break;
case 6: k=30+31+30+31+28+31;
break;
case 7: k=31+30+31+30+31+28+31;
break;
case 8: k=31+31+30+31+30+31+28+31;
break;
case 9: k=30+31+31+30+31+30+31+28+31;
break;
case 10: k=31+30+31+31+30+31+30+31+28+31;
break;
if(year%400==0)
k=k+day+1;
else
k=k+day;
printf("%d",k);
return 0;
}