: 20 ( , , 1980-1-13, 1981.1.1-2000.1.1) , , , 。
#include <stdio.h>
int main()
{
int year,mon,day,sum1,sum2,sum3,t,i,flag1,flag2;
scanf("%d",&t);
while(t--)
{
flag1=flag2=0;
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};// ,2
scanf("%d-%d-%d",&year,&mon,&day);
sum1=sum2=sum3=0;
for(i=year+1;i<year+20;i++)
{
if(i%4==0&&i%100!=0||i%400==0)
sum1+=366;
else
sum1+=365;
}// 20
if(year%4==0&&year%100!=0||year%400==0)
a[2]=29,flag1=1;// 2 29 , flag1=1;
for(i=mon+1;i<13;i++)
sum2=sum2+a[i];
sum2=sum2+a[mon]-day;//
a[2]=28;
if((year+20)%4==0&&(year+20)%100!=0||(year+20)%400==0)
a[2]=29,flag2=1;// flag2=1;
for(i=1;i<mon;i++)
sum3=sum3+a[i];
if(flag1&&!flag2&&mon==2&&day==29)
printf("-1
");// 2 29 , year+20 , 20 。
else
printf("%d
",sum1+sum2+sum3+day);
}
return 0;
}