程序不知道哪出问题了,帮忙看看
#include "stdio.h"#include "conio.h"
struct
{int year;
int month;
int day;
}date;
main()
{int days;
printf("input year,month,day:");
scanf("%d,%d,%d",&date.year,&date.month,&date.day);
switch(date.month)
{case1:days=date.day; break;
case2:days=date.day+31; break;
case3:days=date.day+59; break;
case4:days=date.day+90; break;
case5:days=date.day+120; break;
case6:days=date.day+151; break;
case7:days=date.day+181; break;
case8:days=date.day+212; break;
case9:days=date.day+243; break;
case10:days=date.day+273; break;
case11:days=date.day+304; break;
case12:days=date.day+334; break;
}
if((date.year%4==0&&date.year%100!=0||date.year%400==0)&&date.month>=3)
days+=1;
printf("\n%d/%dis the %dth day in %d.",date.month,date.day,days,date.year);
getch();
}
要求计算日期是一年中的哪一天。结果不对,帮忙看看,谢谢。