欢迎来到天天文库
浏览记录
ID:37914621
大小:50.50 KB
页数:8页
时间:2019-06-02
《c++万年历及公历农历转换源代码1》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#include#include/*主函数*/main(){intcd;for(;;){clrscr();printf("");printf("PleaseChooseOperations");printf("1.Thecalendaroftheyear");printf("2.gonglizhuanhuannongli");printf("3.nonglizhuanhuangongli");printf("4.exit");scanf("%d",&cd
2、);switch(cd){case1:rli();break;case2:gongli();break;case3:nongli();break;case4:exit(0);}}}/*打印公历年历函数*/print(intn){inti;for(i=0;i3、7;}}rli(){inti,j,k,m,n,f1,f2,year,d;inta[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};printf("Pleaseinputtheyear:");scanf("%d",&year);printf("");printf("Thecalendaroftheyear%d",year);d=day(year);if(year%4==0&&year%1004、5、year%400==0)a[2]++;for(i=1;i<=12;i+=2){m=0;n=0;f1=0;f2=0;switch(i){case16、:printf("*1*");break;case3:printf("*3*");break;case5:printf("*5*");break;case7:printf("*7*");break;case9:printf("*9*");break;case11:printf("*11*");break;}printf("");switch(i+1){case2:printf("*2*");break;case4:printf("*4*");break;case6:printf("*6*");break;case8:printf("*8*");break;case10:printf("*17、0*");break;case12:printf("*12*");break;}printf("");printf("SUMOTUWETHFRSASUMOTUWETHFRSA");printf("");for(j=0;j<6;j++){if(j==0){print(d*4);for(k=0;k8、f("");;}else{for(k=0;k<7;k++){if(m9、数*/constintgPastday[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};months[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};constlongNongliData[202]={0xAB500D2,0x4BD0883,0x4AE00DB,0xA5700D0,0x54D0581,0xD2600D8,0xD95
3、7;}}rli(){inti,j,k,m,n,f1,f2,year,d;inta[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};printf("Pleaseinputtheyear:");scanf("%d",&year);printf("");printf("Thecalendaroftheyear%d",year);d=day(year);if(year%4==0&&year%100
4、
5、year%400==0)a[2]++;for(i=1;i<=12;i+=2){m=0;n=0;f1=0;f2=0;switch(i){case1
6、:printf("*1*");break;case3:printf("*3*");break;case5:printf("*5*");break;case7:printf("*7*");break;case9:printf("*9*");break;case11:printf("*11*");break;}printf("");switch(i+1){case2:printf("*2*");break;case4:printf("*4*");break;case6:printf("*6*");break;case8:printf("*8*");break;case10:printf("*1
7、0*");break;case12:printf("*12*");break;}printf("");printf("SUMOTUWETHFRSASUMOTUWETHFRSA");printf("");for(j=0;j<6;j++){if(j==0){print(d*4);for(k=0;k8、f("");;}else{for(k=0;k<7;k++){if(m9、数*/constintgPastday[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};months[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};constlongNongliData[202]={0xAB500D2,0x4BD0883,0x4AE00DB,0xA5700D0,0x54D0581,0xD2600D8,0xD95
8、f("");;}else{for(k=0;k<7;k++){if(m9、数*/constintgPastday[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};months[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};constlongNongliData[202]={0xAB500D2,0x4BD0883,0x4AE00DB,0xA5700D0,0x54D0581,0xD2600D8,0xD95
9、数*/constintgPastday[13]={0,0,31,59,90,120,151,181,212,243,273,304,334};months[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};constlongNongliData[202]={0xAB500D2,0x4BD0883,0x4AE00DB,0xA5700D0,0x54D0581,0xD2600D8,0xD95
此文档下载收益归作者所有