#includestdio.h#includestdlib.h#includeconio.h#includestring.h#includewindows.h//登陆界面函数voidload();voidbackground1();voidchoice1();voidfanhui1();voiddenglu();voidzhuce();intchazhao();//目录界面函数voidmulu();voidbackground();voidchoice();voidadd();voidxiugai();voidshanchu();voiddel();voidchaxun();voidpaixu();voidtongji();voidoutput();voidfinish();voidfanhui2();voidshuchu();intzongren();intchr();intenr();intmar();voidback();floatchinese();floatenglish();floatmath();floatzongmax();//登陆界面结构体structself{chara[10];charb[10];intflg;}s[100]={{admin,admin,1},{1,1,1}};//目录界面结构体structstudent{charnum[10];charname[10];floatchinese;floatenglish;floatmath;floatsum;inta;}stu[5]={{1100,小明,12,18,20,50,1},{1101,小样,20,80,60,160,1}};//登陆界面voidmain(){load();}voidload(){background1();choice1();}voidbackground1(){puts();puts();printf(********************************************\n);printf(欢迎登录学生管理系统);puts();printf(********************************************\n);printf(1.登录2.注册\n);printf(请选择:);}voidchoice1(){inta;scanf(%d,&a);fflush(stdin);switch(a){case1:denglu();break;case2:zhuce();break;default:fanhui1();break;}}voidfanhui1(){printf(输入错误!\n);printf(请重新输入!\n);system(cls);load();}voiddenglu(){structselfs2;charc;inti=0;intj=0;printf(请输入用户名:\n);scanf(%s,s2.a);fflush(stdin);puts();printf(请输入密码:);c=getch();while(c!=13){printf(*);s2.b[i]=c;i++;while((c=getch())==8){if(i==0)continue;putchar('\b');putchar('');putchar('\b');s2.b[--i]=0;}}s2.b[i]=0;s2.flg=1;puts();puts(s2.b);for(i=0;i100;i++){if(!strcmp(s[i].a,s2.a)&&!strcmp(s[i].b,s2.b)){printf(成功!);system(cls);printf(\n\n\n\n\n\n\n\n\n\t\t\t欢迎进入学生管理系统\n\n\n);Sleep(2000);system(cls);mulu();}else{j++;}}if(j==100){fanhui1();}}voidzhuce(){structselfs3;charc,d;inti,j;i=0;printf(请输入帐号:);gets(s3.a);puts(s3.a);printf(请输入密码:);c=getch();while(c!=13){printf(*);s3.b[i]=c;i++;while((c=getch())==8){if(i==0)continue;putchar('\b');putchar('');putchar('\b');s3.b[--i]=0;}}s3.b[i]=0;s3.flg=1;printf(确定'y'取消'n');scanf(%c,&d);fflush(stdin);if(d=='y'||d=='Y'){j=chazhao();s[j]=s3;printf(注册成功!);shuchu();system(cls);fanhui1();}else{fanhui1();}}intchazhao(){inta,i;for(i=0;i100;i++){if(s[i].flg==0){a=i;break;}}returni;}//目录界面voidmulu(){background();choice();}voidbackground(){printf(*****************************************\n);printf(/////////////////////^_^\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n);printf(******************************************\n);puts();printf(欢迎进入学生成绩管理系统);puts();printf(****************************************\n);printf(请输入业务:\n);puts();printf(1.查看所有记录显示\n);printf(2.添加学生成绩\n);printf(3.修改学生成绩\n);printf(4.删除学生成绩\n);printf(5.清空记录\n);printf(6.按要求查询学生成绩\n);printf(7.按要求排序\n);printf(8.按要求统计成绩\n);printf(9.退出\n);printf(请选择:);}voidchoice(){inta;scanf(%d,&a);fflush(stdin);printf(%d\n,a);switch(a){case1:output();break;case2:add();break;case3:xiugai();break;case4:shanchu();break;case5:del();break;case6:chaxun();break;case7:paixu();break;case8:tongji();break;case9:finish();break;default:system(cls);mulu();break;}}voidadd(){system(cls);inti;charc,a;shuchu();printf(1输入2返回主界面\n);scanf(%d,&a);fflush(stdin);if(a==1){for(i=0;i5;i++){if(stu[i].a==0)break;}printf(请输入学号:);scanf(%s,stu[i].num);fflush(stdin);printf(\n请输入姓名:);scanf(%s,stu[i].name);fflush(stdin);printf(\n请输入语文成绩:);scanf(%f,&stu[i].chinese);fflush(stdin);printf(\n请输入英语成绩:);scanf(%f,&stu[i].english);fflush(stdin);printf(\n请输入数学成绩:);scanf(%f,&stu[i].math);fflush(stdin);stu[i].a=1;stu[i].sum=stu[i].chinese+stu[i].english+stu[i].math;shuchu();printf(y返回主界面);scanf(%c,&c);if(c=='Y'||c=='y'){system(cls);mulu();}else{add();}}elseif(a==2){system(cls);mulu();}else{printf(输入错误,请重新输入!);system(cls);add();}}voidxiugai(){chara;system(cls);shuchu();printf(1修改2返回主界面);scanf(%d,&a);fflush(stdin);if(a==1){charb[10];charc;inti;intj=0;printf(请输入需要修改的人的姓名或者学号:);gets(b);fflush(stdin);puts();puts(b);for(i=0;i5;i++){if(!strcmp(stu[i].name,b)||!strcmp(stu[i].num,b)){printf(\n请输入需要修改的学号:);scanf(%s,stu[i].num);fflush(stdin);printf(\n请输入需要修改的姓名:);scanf(%s,stu[i].name);fflush(stdin);printf(\n请输入需要修改的语文成绩:);scanf(%f,&stu[i].chinese);fflush(stdin);printf(\n请输入需要修改的英语成绩:);scanf(%f,&stu[i].english);fflush(stdin);printf(\n请输入需要修改的数学成绩成绩:);scanf(%f,&stu[i].math);fflush(stdin);stu[i].sum=stu[i].chinese+stu[i].english+stu[i].math;break;}else{j++;}}if(j==5){printf(输入错误,请重新输入!);system(cls);xiugai();}system(cls);shuchu();printf(y返回主界面);scanf(%c,&c);if(c=='Y'||c=='y'){system(cls);mulu();}else{xiugai();}}elseif(a==2){system(cls);mulu();}else{printf(输入错误,请重新输入!);system(cls);xiugai();}}voidshanchu(){chara;intj=0;charc;system(cls);shuchu();printf(1删除2返回主界面:);scanf(%d,&a);fflush(stdin);if(a==1){inti;charb[10];printf(请输入需要删除的人的学号或者姓名:);gets(b);fflush(stdin);for(i=0;i5;i++){if(!strcmp(stu[i].name,b)||!strcmp(stu[i].num,b)){stu[i].a=0;printf(删除成功!);break;}else{j++;}}if(j==5){printf(输入错误,请重新输入!);shanchu();}printf(是否返回主界面:(y是));scanf(%c,&c);if(c=='y'||c=='Y'){system(cls);mulu();}else{shanchu();}}elseif(a==2){system(cls);mulu();}else{shanchu();}}voiddel(){chara;system(cls);shuchu();printf(1清空2返回主界面);scanf(%d,&a);fflu