资源描述:
《学生信息管理系统C语言版》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、//交流学习//QQ:1194758555#include#include#include#include#includeintk,n;structstudent{doubleyuwen;doubleshuxue;doubleyingyu;doublezong;doublepingjun;charname[20];charnum[20];}stu[1000];voidjiazai(structstudentstu
2、[],int*num1);voidbaocun(structstudentstu[],intn);voidfind(structstudentstu[],intn);intfindnum(structstudentstu[],intn,char*num);//查找学号;voidshanchu(structstudentstu[],int*num1);voidshanchuyi(structstudentstu[],int*num1);//删除一条记录;voidshanchuquanbu(structstude
3、ntstu[],int*num1);voidtianjiayi(structstudentstu[],inti);//添加一记录;voidtianjia(structstudentstu[],int*num1);//添加记录;voidxiugai(structstudentstu[],intn);//修改一条记录;voidoutput(structstudentstu[],intn,intx);//打印信息;voidpaixu(structstudentstu[],intn);//排序;intjianchax
4、uehao(structstudentstu[],char*num);//检查学号的合法性;intjianchachengji(doublenum);//检查成绩的合法性;voidoutputone(structstudent*stu,inti,intx);//输出一条信息voidcaidan();intmain(){intq;jiazai(stu,&n);caidan();scanf("%d",&q);while(q>6)19{printf("输入错误请重新输入请输入0-6的数字");scanf("
5、%d",&q);}Sleep(300);system("cls");switch(q){case1:tianjia(stu,&n);break;case2:xiugai(stu,n);break;case3:paixu(stu,n);break;case4:find(stu,n);break;case5:shanchu(stu,&n);break;case6:output(stu,n,0);break;case0:exit(0);}return0;}voidcaidan(){printf("┌────────
6、────────────────┐");printf("├───────欢迎进入学生信息管理系统─────┤");printf("├────────────────────────┤");printf("│1添加学生成绩│");printf("├────────────────────────┤");printf("│2修改学生成绩│");printf("├────────────────────────┤");printf("│3排序│");printf("├────────
7、────────────────┤");printf("│4查找│");printf("├────────────────────────┤");19printf("│5删除│");printf("├────────────────────────┤");printf("│6输出│");printf("├────────────────────────┤");printf("│0退出│");printf("├────────────────────────┤");print
8、f("└────────────────────────┘");printf("请输入选择:");}voidjiazai(structstudentstu[],int*num1){FILE*fp;inti;if((fp=fopen("d:\student.dat","r"))==NULL){*num1=0;return;}for(i=0;fread(&stu[i],sizeof(struc