#include<stdio.h>
bool Is_Leap(int year){return(year %4==0&& year %100!=0||(year %400==0);//判断是不是闰年}intYearMonth_To_Day(int year,int month){int day[]={29,31,28,31,30,31,30,31,31,30,31,30,31};if(month ==2&&Is_Leap(year))//注意二月有两个数据{
month =0;}return day[month];}intGet_YMD_To_Total(int year,int month,int day){int total =0;int i =1;if(year <1)return-1;if(month <1|| month >12)return-2;if(day <1|| day >YearMonth_To_Day(year, month))return-3;for(int i =1; i < month;++i){
total +=yearMonth_To_Day(year, i);}return total + day;}intmain(){int year =0, month =0, day =0, total =0;scanf_s("%d%d%d",&year,&month,&day);
total =Get_YMD_To_Total(year, month, day);if(total >0){printf("%d year %d month %d day => total \n", year, month, day, total);}else{printf("input error \n");}return0;}