diff --git a/中原4号.c b/中原4号.c new file mode 100644 index 0000000..ee4e617 --- /dev/null +++ b/中原4号.c @@ -0,0 +1,357 @@ +#include +#include +#include +int Year(int A)/*֮ǰһ*/ +{ + int i,day,s=0; + 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 Month(int B,int C)/*·ж*/ + { + enum monthday{Jan=1,Feb=2,Mar=3,Apr=4,May=5,Jun=6,Jul=7,Aug=8,Sept=9,Nov=11,Oct=10,Dec=12};/*ö*/ + switch(C) + { + case Jan: + return 31; + case Feb: + if( B%4==0 && B%100!=0 || B%400==0 ) + return 29; + else + return 28; + case Mar: + return 31; + case Apr: + return 30; + case May: + return 31; + case Jun: + return 30; + case Jul: + return 31; + case Aug: + return 31; + case Sept: + return 30; + case Oct: + return 31; + case Nov: + return 30; + case Dec: + return 31; + default: + return -1; + } + } + void Day(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("~~~~~~~~~~~~ڿ˯~DzѼ~~~~~~~~~~~~~\n");break; + case 0: printf("~~~~~~~~~~~~~졣ӭһܵѧϰǵԤϰѼ~~~~~~~~~~~~~~\n");break; + } + } + void Holiday(int F,int G) /*жǷΪ*/ + { + if( F==1&&G==1||F==5&&G==1||F==10&&G==1||F==3&&G==8||F==3&&G==12||F==5&&G==4||F==6&&G==1||F==7&&G==1||F==8&&G==1||F==9&&G==10) + printf(" ~~ǹգ~~\n"); + else + printf(" ~~첻ǹ~~\n"); + } + void huanying() //ӭ + { + system("color 0D"); + float y,x; + for ( y = 1.5f; y > -1.5f; y -= 0.1f) + { + for ( x = -1.5f; x < 1.5f; x += 0.05f) + { + float a = x * x + y * y - 1; + putchar(a * a * a - x * x * y * y * y <= 0.0f ? '*' : ' '); + } + putchar('\n'); + } + printf("=======================óԭ======================="); + Sleep(1000);//ʱ + system("cls");// + } + struct zuozhe + { + int age; + float h; + float w; + }; + int caidan() + { + FILE *fp; + fp=fopen("ʵ.txt","w"); + printf("\n~~~~~~~~~~~~~~~~~~~~~~~ףѡ666оϲޣ~~~~~~~~~~~~~~~~~~~~~~~~"); + fclose(fp); + } + void main() +{ + int year,month,day,year1,month1,day1,d,j,Z,d1,d2,D,cha,Z1,hui,gong,s=-1; + huanying(); + system("color 0E"); + printf("******************************************************************************\n");/*78*ɴ˿֪DEVC++һ80ַ*/ + printf("* *\n"); + printf("* *\n"); + printf("*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ӭʹ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*\n"); + printf("* *\n"); + printf("* *\n"); + printf("******************************************************************************\n"); + printf("¹ܣ\n\n"); + printf("1.һݣĻʾٶ1940-2040֮䡣\n\n"); + printf("2.£µ\n\n") ; + printf("3.գ컹ж죬ڼǷǹա\n\n"); + hui=1; + while(hui==1) //жûǷظʹó + { + do + { + printf("ҪʹõĹ:"); + scanf ("%d",&gong); + printf("\n"); + switch(gong) + { + case 1: + { + printf("ѯ:"); + scanf ("%d",&year); + while(year==0) + { + printf("\nףû0~\n\n"); + printf("ѯݣ") ; + scanf("%d",&year) ; + } + printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); + printf("\n\n %d\n\n",year); + Z=Year(year); //ZʾĿǰΪֹ + for(j=1;j<=12;j++) //ѭʾ1~12 + { + d=Z%7+1; //dʾһڼΪ7Ϊ + printf("==================================\n"); //34= + printf (" %d·\n",j); + printf (" һ ܶ \n"); + if(d<7) //շλÿո + for(d1=1;d1<=d;d1++) + printf(" "); //5ո + for(d2=1;d2<=Month(year,j);d2++) //d2ʾµ + { + printf("%d",d2); + if(d2<10) + printf(" "); //4ո + else + printf(" "); //3ո + if((d2+d)%7==0 || d2==Month(year,j)) //ƻ + printf("\n"); + } + Z=Z+Month(year,j); //һ + } + break; + } + case 2: + { + printf("ѯ:"); + scanf ("%d",&year); + while(year==0) + { + printf("\nףû0~\n\n"); + printf("ѯݣ") ; + scanf("%d",&year) ; + } + printf("\nѯ·:"); + scanf ("%d",&month); + while(month!=1&&month!=2&&month!=3&&month!=4&&month!=5&&month!=6&&month!=7&&month!=8&&month!=9&&month!=10&&month!=11&&month!=12) + { + printf("\nףһֻ12ޣ1~12~\n\n"); + printf ("·:"); + scanf("%d",&month); + } + printf("\n"); + Z=Year(year); + for(j=1;j<=month-1;j++) //ѯ·֮ǰ + { + D=Month(year,j); + Z=Z+D; + } + d=Z%7+1; + printf("==================================\n\n"); + printf(" %d\n\n",year); + printf (" %d·\n\n",j); + printf (" һ ܶ \n"); + if (d<7) + for (d1=1;d1<=d;d1++) + printf(" "); + for (d2=1;d2<=Month(year,j);d2++) + { + printf ("%d",d2); + if (d2<10) + printf (" "); + else + printf (" "); + if ((d2+d)%7==0 || d2==Month(year,j)) + printf ("\n"); + } + break; + } + case 3: + { + printf("==================================\n\n"); + printf ("ѯ:"); + scanf ("%d",&year); + while(year==0) + { + printf("\nףû0~\n\n"); + printf("ѯݣ") ; + scanf("%d",&year) ; + } + printf ("\nѯ·:"); + scanf ("%d",&month); + while(month!=1&&month!=2&&month!=3&&month!=4&&month!=5&&month!=6&&month!=7&&month!=8&&month!=9&&month!=10&&month!=11&&month!=12) + { + printf("\nףһֻ12ޣ1~12~\n\n"); + printf ("·:"); + scanf("%d",&month); + } + printf ("\nѯ:"); + scanf ("%d",&day); + while(day>Month(year,month)||day<1) + { + printf("\nףûôޣ\n\n"); + printf("ֻ%d~",Month(year,month)); + printf("\n\nѡպ:"); + scanf("%d",&day); + } + printf("\n") ; + Z=Year(year); + for(j=1;j<=month-1;j++) + { + D=Month(year,j); + Z=Z+D; + } + Z=Z+day; + printf("----------------------------------\n\n"); + printf("뵱ǰ:"); + scanf ("%d",&year1); + while(year1==0) + { + printf("\nףû0~\n\n"); + printf("ѯݣ") ; + scanf("%d",&year1) ; + } + printf("\n뵱ǰ·:"); + scanf ("%d",&month1); + while(month1!=1&&month1!=2&&month1!=3&&month1!=4&&month1!=5&&month1!=6&&month1!=7&&month1!=8&&month1!=9&&month1!=10&&month1!=11&&month1!=12) + { + printf("\nףһֻ12ޣ1~12~\n\n"); + printf ("·:"); + scanf("%d",&month1); + } + printf("\n뵱պ:"); + scanf ("%d",&day1); + while(day1>Month(year1,month1)||day1<1) + { + printf("\nףûôޣ\n\n"); + printf("ֻ%d~",Month(year1,month1)); + printf("\n\nѡպ:"); + scanf("%d",&day1); + } + printf("\n==================================\n\n"); + Z1=Year(year1); + for (j=1;j<=month1-1;j++) + { + D=Month(year1,j); + Z1=Z1+D; + } + Z1=Z1+day1; + cha=Z-Z1; + printf("ھ%d\n\n",cha); + d=Z%7; + Day(d); //ѯڼ + printf("\n"); + Holiday(month,day) ; + break; + } + case 666: + { + struct zuozhe Zzy;//¼Ϣ + Zzy.age=19; + Zzy.h=174.1; + Zzy.w=66.6;; + printf(" |==========================================|\n"); //15ո + printf(" | Ϣ |\n"); + printf(" | ԭ |\n"); + printf(" | 䣺%2.d |\n",Zzy.age); + printf(" | ߣ%.1fcm |\n",Zzy.h); + printf(" | أ%.1fkg |\n",Zzy.w); + printf(" | ãܲ |\n"); + printf(" |==========================================|\n"); + break; + } + case 999: + { + int i; + int l; + char A[20]={"I LOVE YOU"}; + i = 3;//'i'ֵ + printf("\n %10c%10c\n %7c%6c%4c%6c\n", i, i, i, i, i, i); + printf(" %5c%10c%10c\n %6c %s%4c\n", i, i, i, i, A, i); + printf(" %8c%14c\n %10c%10c\n %12c%6c\n", i, i, i, i, i, i); + printf(" %14c%2c\n %14c%2c\n", i, i, i, i); + printf(" %8c%6c%2c%6c\n", i, i, i, i); + printf(" %7c %c %c %c%4c %c %c %c\n", i, i, i, i, i, i, i, i, i); + printf(" %7c %c %c %c %c %c %c %c %c\n", i, i, i, i, i, i, i, i, i); + for (l = 0; l < 10; l++) + { + printf(" %14c%c%c\n", i, i, i); + } + caidan(); + break; + } + default: + { + printf("ףûд˹ޣ\n\n"); + printf("ѡĹܣ\n\n") ; + break; + } + } + }while(gong!=1&&gong!=2&&gong!=3&&gong!=666&&gong!=999); + printf("\n"); + printf("ʹã밴1\n\n˳밴2\n\nѡ"); + scanf("%d",&hui); + while(hui!=1&&hui!=2) + { + printf("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"); + printf("ףСûбĹޣ"); + printf("\n\nѡ12~\n\n"); + printf("ʹã밴1\n\n˳밴2\n\nٴѡ"); + scanf("%d",&hui); + } + printf("\n"); + if(hui==1) + { + printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~ǵĹܰȣ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n"); + printf("1.һݣĻʾٶ1940-2040֮䡣\n\n"); + printf("2.£µ\n\n") ; + printf("3.գ컹ж죬ڼǷǹա\n\n"); + } + else + { + printf("=========================лԱʹã=========================\n"); + } + + } + } diff --git a/中原4号.exe b/中原4号.exe new file mode 100644 index 0000000..5cd3f01 Binary files /dev/null and b/中原4号.exe differ diff --git a/彩蛋解析.txt b/彩蛋解析.txt new file mode 100644 index 0000000..e69de29