#include<stdio.h>
#include<stdlib.h>
int leap(int n,int m)
{
if(n%4==0 && n%100!=0 || n%400==0 || n==0)
{
if(m>=3)
{
return 1;
}
}
else
return 0;
}
int main(void)
{
int month[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};
int y1,m1,d1,y2,m2,d2;
while(scanf("%d%d%d%d%d%d",&y1,&m1,&d1,&y2,&m2,&d2)==6)
{
int total_1,total_2;
total_1=(y1-1)*365 + (y1-1)/4 - (y1-1)/100 + (y1-1)/400 + month[m1] + leap(y1,m1) + d1;
total_2=(y2-1)*365 + (y2-1)/4 - (y2-1)/100 + (y2-1)/400 + month[m2] + leap(y2,m2) + d2;
printf("%d\n",abs(total_1-total_2));
}
}
您的答案為: 126834 正確答案為: 126833