#include <stdio.h>
int main()
{
int birth_y,brith_m,brith_d;
printf("请输入您的出生年月日”);
scanf("%d%d%d",&birth_y,&brith_m,&brith_d);
int cur_y,cur_m,cur_d;
printf("请输入现在的年月日”);
scanf("%d%d%d",&cur_y,&cur_m,&cur_d);
int sum=0,sum_y=0,fir=0,end=0;
for(int i=1;i<cur_y-birth_y;i++)//相差年数的有多少天数
{
if((birth_y+i)%4==0&&(birth_y+i)%100!=0||(birth_y+i)%400==0)
{
sum_y += 366;
}
else
{
sum_y += 365;
}
}
switch(cur_m-1)//现在到年初的时间
{
case 11:
fir+=30;
case 10:
fir+=31;
case 9:
fir+=30;
case 8:
fir+=31;
case 7:
fir+=31;
case 6:
fir+=30;
case 5:
fir+=31;
case 4:
fir+=30;
case 3:
fir+=31;
case 2:
if(cur_y%4==0&&cur_y%100!=0||cur_y%400==0)
{
fir+=28;
}
else
{
fir+=29;
}
case 1:
fir+=31;
}
switch(brith_m+1)//出生日期到年末的时间
{
case 2:
if(birth_y%4==0&&birth_y%100!=0||birth_y%400==0)
{
end+=28;
}
else
{
end+=29;
}
case 3:
end+=31;
case 4:
end+=30;
case 5:
end+=31;
case 6:
end+=30;
case 7:
end+=31;
case 8:
end+=31;
case 9:
end+=30;
case 10:
end+=31;
case 11:
end+=30;
case 12:
end+=31;
}
if(brith_m==1||brith_m==3||brith_m==5||brith_m==7||brith_m==8||brith_m==10||brith_m==12)
{
end+=31-brith_d;
}
else if(brith_m==4||brith_m==6||brith_m==9||brith_m==11)
{
end+=30-brith_d;
}
else
{
if(birth_y%4==0&&birth_y%100!=0||birth_y%400==0)
{
end+=28-brith_d;
}
else
{
end+=29-brith_d;
}
}
sum=sum_y+fir+end;
printf("%d\n",sum);
return 0;
}