diff --git a/年历.cpp b/年历.cpp index d7acb3d..f2b30c6 100644 --- a/年历.cpp +++ b/年历.cpp @@ -63,81 +63,17 @@ int holiday(int F,int G) // else if(F==8&&G==1) printf("\nµ±ÌìΪ½¨¾ü½Ú\n"); else if(F==10&&G==1) printf("\nµ±ÌìΪ¹úÇì½Ú\n"); else - printf("\nµ±Ìì²»ÊÇ·¨¶¨½ÚÈÕ"); + printf("\nµ±Ìì²»ÊÇ·¨¶¨½ÚÈÕ\n"); } using namespace std; -int P() -{ - - int year,d,j,Z,ds,dd,m,n,D,x,y,z,h,k,l,B,Z1; - printf("\nÊäÈëÄãËù²éÑ°ÈÕÀúµÄÄê·Ý£º"); - scanf("%d",&year); - if((year%4==0&&year%100!=0)||year%400==0) - { - printf("\n=========¸ÃÄêÊÇÈòÄê========="); - printf("\a"); - } - else - { - printf("\n=========¸ÃÄêÊÇÈòÄê========="); - printf("\a"); - } - Z=Y(year); - for(j=1;j<=12;j++) - { - d=Z%7; - printf("\n----------------------------\n"); - printf(" %dÔ·Ý\n",j); - printf("SUN MON TUE WED THU FRI SAT\n"); - if(d<6) - for(ds=1;ds<=d+1;ds++) - printf(" "); - for(dd=1;dd<=month(year,j);dd++) - { - printf ("%d",dd); - if (dd<10) - printf(" "); - else - printf(" "); - if (dd==6-d||(dd-6+d)%7==0||dd==month(year,j)) - printf("\n"); - } - Z=Z+month(year,j); - } - printf("\nÊäÈëËù²éÈÕÀúµÄÄêÔ£º"); - scanf("%d%d",&m,&n); - Z=Y(m); - for(j=1;j<=n-1;j++) - { - D=month(m,j); - Z=Z+D; - } - d=Z%7; - printf("\n----------------------------\n"); - printf(" %dÔ·Ý\n",j); - printf("SUN MON TUE WED THU FRI SAT\n"); - if(d<6) - for(ds=1;ds<=d+1;ds++) - printf(" "); - for(dd=1;dd<=month(year,j);dd++) - { - printf("%d",dd); - if(dd<10) - printf(" "); - else - printf(" "); - if(dd==6-d||(dd-6+d)%7==0||dd==month(year,j)) - printf("\n"); - } -} - int main(void) { int year,d,j,Z,ds,dd,m,n,D,x,y,z,h,k,l,B,Z1,C; - printf("\n***********ÄêÀúÏÔʾ***********"); - printf("\n 1. ²éѯÄêÀú\n 2. ²éѯ¾ßÌåÔ·Ý\n 3. ¾ßÌåÈÕÆÚ\n 4. ÈÕÆÚ¼ä¾à\n"); - printf("******************************\n"); + Chongfu: + printf("\n¡ö¡ö¡ö¡ö¡ö¡ö¡öÄêÀúÏÔʾ¡ö¡ö¡ö¡ö¡ö¡ö¡ö"); + printf("\n¡ö 1. ²éѯÄêÀú ¡ö\n¡ö 2. ²éѯ¾ßÌåÔÂ·Ý ¡ö\n¡ö 3. ¾ßÌåÈÕÆÚ ¡ö\n¡ö 4. ÈÕÆÚ¼ä¾à ¡ö\n¡ö 5. Í˳ö³ÌÐò ¡ö\n"); + printf("¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö¡ö\n"); printf("\nÇëÊäÈë¶ÔÓ¦Êý×ÖÒÔÖ´ÐÐÏàÓ¦²Ù×÷£º"); scanf("%d",&C); if(C==1) @@ -176,7 +112,8 @@ int main(void) } Z=Z+month(year,j); } - printf("\n¸ÐлÄúµÄʹÓã¡"); + printf("\n¸ÐлÄúµÄʹÓã¡\n"); + goto Chongfu; } if(C==2) { @@ -205,7 +142,8 @@ int main(void) if(dd==6-d||(dd-6+d)%7==0||dd==month(year,j)) printf("\n"); } - printf("\n¸ÐлÄúµÄʹÓã¡"); + printf("\n¸ÐлÄúµÄʹÓã¡\n"); + goto Chongfu; } if(C==3) { @@ -222,7 +160,8 @@ int main(void) d=Z%7; weekday(d); holiday(y,z); - printf("\n¸ÐлÄúµÄʹÓã¡"); + printf("\n¸ÐлÄúµÄʹÓã¡\n"); + goto Chongfu; } if(C==4) { @@ -247,10 +186,17 @@ int main(void) B=Z1-Z; printf("\nÊäÈëÈÕÆÚ¾à½ñÓÐ%dÌì\n",B); d=Z%7; - printf("\n¸ÐлÄúµÄʹÓã¡"); + printf("\n¸ÐлÄúµÄʹÓã¡\n"); + } + if(C==5) + { + printf("\n¸ÐлÄúµÄʹÓã¡\n"); + } + if(C!=1&&C!=2&&C!=3&&C!=4&&C!=5) + { + printf("\nÇëÊäÈëÕýÈ·Êý×Ö"); + goto Chongfu; } - if(C!=1&&C!=2&&C!=3&&C!=4) - printf("\nÇëÖØÆô²¢ÊäÈëÕýÈ·Êý×Ö"); } diff --git a/年历.exe b/年历.exe index 5510d09..2807579 100644 Binary files a/年历.exe and b/年历.exe differ