#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
int y, m, day;
int sum = 0;
int lean = 0, i;
int run[12] = {31,29,31,30,31,30,31,31,30,31,30,31,};
int ping[12] = { 31,28,31,30,31,30,31,31,30,31,30,31,};
printf("请输入年月日,用空隔隔开\n");
scanf("%d%d%d",&y,&m,&day);
if (y % 4 == 0 && y % 100 != 0)
{
lean = 1;
}
else
{
if (y%400 == 0)
{
lean = 1;
}
else
{
lean = 0;
}
}
if (lean == 1)
{
for (i = 0; i < m - 1; i++)
{
sum += run[i];
}
sum += day;
printf("%d 天",sum);
}
else
{
for (i = 0; i < m - 1; i++)
{
sum += ping[i];
}
sum += day;
printf("%d 天", sum);
}
return 0;
}