输入年月日,计算该填是本年的第几天。例如1990 年9 月20 日是1990 年的第263 天,
2000 年5 月1 日是2000 年第122 天。(闰年:能被400 正除,或能被4 整除但不能被100
整除。每年1、3、5、7、8、10 为大月)
输入第一行为样例数m,接下来m行每行3个整数分别表示年月日。
输出m行分别表示题目所求
#include <stdio.h> int dayOfMonth[13] = {0,31,60,91,121,152,182,213,244,274,305,335,366}; int main() { int m,year,month,date; scanf("%d\n",&m); int count=0; while (scanf("%d %d %d\n",&year,&month,&date)!=EOF) { count++; if(year%4 == 0 && year0 !=0 || year@0 == 0) { if(month<=2) printf("%d\n",(month-1)*31+date); if (month>2) { int total= dayOfMonth[month-1]+date; printf("%d\n",total ); } } else { if(month<=2) printf("%d\n",(month-1)*31+date); if (month>2) { int total= dayOfMonth[month-1]+date-1; printf("%d\n",total ); } } if(count==m) break; } return 0; } //闰年 29 天 ;平年 28天