#includestdio.h#includestdlib.hvoidmain(){intyear,month,day;voidnextdate(int,int,int);printf(请输入年份(范围在1912-2050之间):);scanf(%d,&year);printf(请输入月份(范围在1-12之间):);scanf(%d,&month);printf(请输入日期(范围在1-31之间):);scanf(%d,&day);printf(%d年%d月%d日的下一天是:,year,month,day);nextdate(year,month,day);}voidnextdate(intyear,intmonth,intday){intleap(int);switch(month){case1:case3:case5:case7:case8:case10:if(day=1&&day31)day=day+1;elseif(day==31){day=1;month=month+1;}elseprintf(输入数据错误!\n);break;case12:if(day=1&&day31)day=day+1;elseif(day==31){day=1;month=1;year=year+1;}else{printf(输入数据错误!\n);exit(0);}break;case4:case6:case9:case11:if(day=1&&day30)day=day+1;elseif(day==30){day=1;month=month+1;}else{printf(输入数据错误!\n);exit(0);}break;case2:if(day=1&&day28)day=day+1;elseif(!leap(year)&&day==28){day=1;month=month+1;}elseif(leap(year)&&day==28)day=day+1;elseif(leap(year)&&day==29){day=1;month=month+1;}else{printf(输入数据错误!\n);exit(0);}}printf(%d年%d月%d日\n,year,month,day);}intleap(intyy){return(yy%400==0||(yy%4==0&&yy%100!=0));}