commit 0c711e5fa3fd444b82b1d305dbf9876b7b6e36db Author: 2970023988@qq.com <2970023988@qq.com> Date: Fri Jan 11 11:47:21 2019 +0800 first commit diff --git a/源代码.c b/源代码.c new file mode 100644 index 0000000..63f5b6f --- /dev/null +++ b/源代码.c @@ -0,0 +1,133 @@ +#include +int how(int A)//㹫Ԫ11ŵ֮ǰĺ +{ + int i,s=0,day; + for (i=1;i<=A-1;i++) + { + if (i%4==0 && i%100!=0 || i%400==0) + day=366; + else + day=365; + s=s+day;} + return s; +} +int where(int B,int C)//жÿ +{ + int tian; + switch(C) + { case 1: tian=31;break; + case 2: + if (B%4==0 && B%100!=0 || B%400==0) + tian=29; + else + tian=28;break; + case 3: tian=31;break; + case 4: tian=30;break; + case 5: tian=31;break; + case 6: tian=30;break; + case 7: tian=31;break; + case 8: tian=31;break; + case 9: tian=30;break; + case 10: tian=31;break; + case 11: tian=30;break; + case 12: tian=31;break; + } + return tian; +} +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; + } +} +void when(int F,int G)//жǷΪ +{ + if (F==1 && G==1 || F==5 && G==1 || F==10 && G==1|| F==3 && G==8 || F==6 && G==1 || F==9 && G==10) + printf ("Ϊ"); + else + printf ("첻Ƿ"); +} + +void main() +{ int year,d,j,Z,di,did,m,n,D,x,y,z,h,k,l,jian,Z1;//d11ڼZ + printf ("ӭѯϵͳ!\n"); + 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); //һµ1һڼ + } + 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Ϊǰյ + Z1=how(h); + for (j=1;j<=k-1;j++) + { + D=where(k,j); + Z1=Z1+D; + } + Z1=Z1+l; + jian=Z1-Z; + printf ("ھ%d\n",jian); + d=Z%7; + why(d); + when(y,z); +}