int year = 0, month = 0, day = 0, sum = 0;
scanf("%d%d%d",&year,&month,&day);
int days[] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
if ((year % 400 == 0) || (year % 100 != 0 && year % 4 == 0)) days[1] = 29;
for (int i = 0; i < month-1;i++)
sum += days[i];
printf("%d", sum+day); |