全文预览

C语言课程设计实验报告(万年历)

上传者:火锅鸡 |  格式:doc  |  页数:18 |  大小:0KB

文档介绍
onth==6)switch(day){case1:printf(",这天是儿童节");}if(month==7)switch(day){case1:printf(",这天是建党节");}if(month==8)switch(day){case1:printf(",这天是建军节");}if(month==9)switch(day){case10:printf(",这天是教师节");}if(month==10)switch(day){case1:printf(",这天是国庆节");}}voidsetDay1(intyear,intmonth,intday)/*通过键盘“↑”“↓”控制年历的变换*/{chark;getch();k=getch();switch(k) {caseKEYNUMUp:/*“↑”年份减小*/if(year<2){system("cls");printf("警告!超出范围!\n");break;}?year--;display1(year);setDay1(year,month,day);break;caseKEYNUMDown:/*“↓”年份变大*/year++;display1(year);setDay1(year,month,day);break;default:system("cls");}}voidsetDay2(intyear,intmonth,intday)/*通过键盘“←”“→”控制月历的变换*/{chark;getch();k=getch();switch(k){caseKEYNUMLeft:/*“←”月份变小*/if(month<2){month+=12;year--;}if(year<1){?system("cls");printf("警告!超出范围!\n");break;}month--;display2(year,month);

收藏

分享

举报
下载此文档