diff --git a/选课系统2.c b/选课系统2.c new file mode 100644 index 0000000..0e81a7b --- /dev/null +++ b/选课系统2.c @@ -0,0 +1,106 @@ +#include +#include +void Mangers() +{ +int n,w=1,flag=0,i=3; +char s[8]; +char password[7]="1"; +do +{ +printf("\n\nEnter password:"); +scanf("%s",s); +if(!strcmp(s,password)) +{ +flag=1; +break; +} +else +{ +printf("\n\nError! You only have %d times! Enter again:\n",i-1); +i--; +} +} +while(i>0); +if(!flag) +{ +printf("you have Enter 3 times!"); +exit(0); +} +do +{ +system("cls"); +printf("\n\n\t\t*********************¹ÜÀíÔ±²Ëµ¥***********************\n\n"); +printf("\t\t\t\t1---ä¯ÀÀ¿Î³Ì\n"); +printf("\t\t\t\t2---²éѯ¿Î³Ì\n"); +printf("\t\t\t\t3---Ìí¼Ó¿Î³Ì\n"); +printf("\t\t\t\t4---ɾ³ý¿Î³Ì\n"); +printf("\t\t\t\t5---·µ»ØÖ÷²Ëµ¥"); +printf("\n\n\t\t******************************************************\n"); +printf("Chiose your number(1-5):[ ]\b\b"); +scanf("%d",&n); +switch(n) +{ +case 1:prin();break; +case 2:search();break; +case 3:insert();savefile();break; +case 4:del();savefile();break; +case 5:return; +default:; +} +} +while(w==1); +} +void Students() +{ +int n,w=1; +do +{ +system("cls"); +puts("\n\n\t\t*********************ѧÉú²Ëµ¥***********************\n\n"); +puts("\t\t\t\t1---ä¯ÀÀËùÓпγÌ\n"); +puts("\t\t\t\t2---²éѯ¿Î³ÌÐÅÏ¢\n"); +puts("\t\t\t\t3---Ñ¡ÔñÑ¡Ð޿γÌ\n"); +puts("\t\t\t\t4---ä¯ÀÀÎÒÑ¡Ð޵ĿγÌ\n"); +puts("\t\t\t\t5---ɾ³ý´íÑ¡¿Î³Ì\n"); +puts("\t\t\t\t6---·µ»ØÖ÷²Ëµ¥"); +puts("\n\n\t\t****************************************************\n"); +printf("Chiose your number(1-6):[ ]\b\b"); +scanf("%d",&n); +switch(n) +{ +case 1:prin();break; +case 2:search();break; +case 3:choose();break; +case 4:prin1();break; +case 5:del();savefile1();break; +case 6:return; +default:; +} +} +while(w==1); +} +int main() +{ +int n,w=1; +do +{ +system("cls"); +puts("\n\n\t\t*********************MENU***********************\n\n"); +puts("\t\t\t\t1.ÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼(password 1)\n"); +puts("\t\t\t\t2.ÒÔѧÉúÉí·ÝµÇ¼\n"); +puts("\t\t\t\t3.Í˳ö"); +puts("\n\n\t\t************************************************\n"); +printf("Chiose your number(1-3):[ ]\b\b"); +scanf("%d",&n); +switch(n) +{ +case 1:Mangers() ;break; +case 2:Students();break; +case 3:w=0;break; +default:; +} +} +while(w==1); +return 0; +} +