diff --git a/why函数.c b/why函数.c deleted file mode 100644 index f7c60e4..0000000 --- a/why函数.c +++ /dev/null @@ -1,13 +0,0 @@ -void why(int E) -{ - switch(E) - { - case 1: printf("¸ÃÈÕÐÇÆÚÒ»\n");break; - case 2: printf("¸ÃÈÕÐÇÆÚ¶þ\n");break; - case 3: printf("¸ÃÈÕÐÇÆÚÈý\n");break; - case 4: printf("¸ÃÈÕÐÇÆÚËÄ\n");break; - case 5: printf("¸ÃÈÕÐÇÆÚÎå\n");break; - case 6: printf("¸ÃÈÕÐÇÆÚÁù\n");break; - case 7: printf("¸ÃÈÕÐÇÆÚÈÕ\n");break; - } -} /*****ÅжÏÊäÈëÈÕÆÚÊÇÐÇÆÚ¼¸*****/ diff --git a/主函数.c b/主函数.c new file mode 100644 index 0000000..f139694 --- /dev/null +++ b/主函数.c @@ -0,0 +1,75 @@ +int main() +{ + int year,d,j,D,Z,di,did,m,n,x,y,z,h,k,l,jian,Z1; + printf("ÇëÊäÈëÄãËù²éÑ°ÈÕÀúµÄÄê·Ý:"); + scanf("%d",&year); + Z=how(year); + for(j=1;j<=12;j++) + { + d=Z%7; + printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); + printf(" %dÔ·Ý\n",j); + printf("sun mon tue wed thu fri sat\n"); + if(d<6) + for(di=1;di<=d+1;di++) + printf(" "); + for(did=1;did<=where(year,j);did++) + { + printf("%d",did); + if(did<10) printf(" "); + else printf(" "); /*****ÅÅ°æÕûÆë*****/ + if(did==6-d||(did-6+d)%7==0||did==where(year,j)) + printf("\n"); + } + Z=Z+where(year,j); + } + printf("ÇëÊäÈëËù²éÈÕÀúµÄÄêÔÂ:"); + scanf("%d%d",&m,&n); + Z=how(m); + for(j=1;j<=n-1;j++) + { + D=where(m,j); + Z=Z+D; + } + d=Z%7; + printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"); + printf(" %dÔ·Ý\n",j); + printf("sun mon tue wed thu fri sat\n"); + if(d<6) + for(di=1;di<=d+1;di++) + printf(" "); + for(did=1;did<=where(year,j);did++) + { + printf("%d",did); + if(did<10) printf(" "); + else printf(" "); + if(did==6-d||(did-6+d)%7==0||did==where(year,j)) + printf("\n"); + } + printf("ÊäÈëÄêÔÂÈÕ:"); + scanf("%d%d%d",&x,&y,&z); + Z=how(x); + for(j=1;j<=y-1;j++) + { + D=where(x,j); + Z=Z+D; + } + Z=Z+z; + printf("ÊäÈ뵱ǰÄêÔÂÈÕ:"); + scanf("%d%d%d",&h,&k,&l); + Z1=how(h); + for(j=1;j<=k-1;j++) + { + D=where(k,j); + Z1=Z1+D; + } + Z1=Z1+1; + jian=Z1-Z; + if(jian<0) jian=-jian; /*****ת³ÉÕýÊý*****/ + printf("ÊäÈëÈÕÆÚ¾à½ñÓÐ%dÌì\n",jian); + d=Z%7; + why(d); + when(y,z); + system("pause"); /*****Ç¿ÖÆÔÝÍ£*****/ + return 0; +}