不好意思,搞错了!#include "stdio.h"
int main( )
{
int ri,repeat;
int year, month,day, day_year;
int day_of_year(int year, int month, int day);
scanf("%d",&repeat);
for(ri=1;ri<=repeat;ri++){
scanf("%d%d%d",&year, &month, &day);
day_year=day_of_year(year,month,day);
printf("%d\n", day_year);
}
}
day_of_year(int year, int month, int day)
{
int res,day_before_month;
res=0;
switch(month){
case 1:day_before_month=0;break;
case 2:day_before_month=31;break;
case 3:day_before_month=59;break;
case 4:day_before_month=90;break;
case 5:day_before_month=120;break;
case 6:day_before_month=151;break;
case 7:day_before_month=181;break;
case 8:day_before_month=212;break;
case 9:day_before_month=243;break;
case 10:day_before_month=273;break;
case 11:day_before_month=304;break;
case 12:day_before_month=334;break;
}
if((year%4==0&&year%100!=0)||(year%400==0)&&(month>2))
res=day_before_month+1+day;
else
res=day_before_month+day;
return res;
}