您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > C语言中求日期下一天代码
#includestdio.hintmain(){intyear,month,day,leap;scanf(%d%d%d,&year,&month,&day);if(month==2){if(year%400==0)leap=1;elseif(year%100==0)leap=0;elseif(year%4==0)leap=1;elseleap=0;if(leap==1){if(day=28)day=day+1;elseif(day==29){month=3;day=1;}}if(leap==0){if(day=27)day=day+1;elseif(day==28){day=1;month=3;}}}elseif(month==12){if(day=30)day=day+1;elseif(day==31){year=year+1;month=1;day=1;}}elseif(month==4||month==6||month==9||month==11){if(day=29)day=day+1;elseif(day==30){month=month+1;day=1;}}else{if(day=30)day=day+1;elseif(day==31){day=1;month=month+1;}}printf(%d%d%d,year,month,day);return0;}
本文标题:C语言中求日期下一天代码
链接地址:https://www.777doc.com/doc-7187925 .html