欢迎来到天天文库
浏览记录
ID:56785493
大小:46.50 KB
页数:16页
时间:2020-07-11
《c语言--学生信息管理系统代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、#include#include#include#defineFUNC_NEW1/*建立新的班级学生数据*/#defineFUNC_SAVE2/*把数据写入文件并保存*/#defineFUNC_OPEN3/*打开文件并从里读入数据*/#defineFUNC_INSERT4/*插入一个学生的信息*/#defineFUNC_SEARCH5/*查找学生的信息*/#defineFUNC_CHANGE6/*修改学生的信息*/#defineFUNC_DELETE7/*删除学
2、生的信息*/#defineFUNC_DISPLAY8/*展示学生的信息*/#defineFUNC_CENSUS9/*分段统计学生总分人数并打印*/#defineFUNG_EXIT10/*结束程序*/#defineFUNC_CLOSE10#defineMAX_NUM45#defineMAX_NAME_STRLEN30voidDoSave();voidDoOpen();voidDoNew();voidDoInsert();voidDoDisplay();voidDoDelete();voidDoSearch();voidD
3、oChange();voidDocensus();voidDoExit();//用户定义的类型声明struct_student{intid;charname[MAX_NAME_STRLEN];intMath;intEnglish;intChinese;intPhysics;intChemistry;floataverScore;intsum;};typedefstruct_studentSTUD;struct_studTb{STUDstud[MAX_NUM];intlength;};//全局变量的定义struct_st
4、udTbsi;charstrClassId[15];intmain(){intiUserSelect;intMainMenu();system("color20");for(;;){iUserSelect=MainMenu();if(FUNC_CLOSE==iUserSelect)break;switch(iUserSelect){caseFUNC_NEW:DoNew();break;caseFUNC_OPEN:DoSave();break;caseFUNC_SAVE:DoOpen();break;caseFUNC_I
5、NSERT:DoInsert();break;caseFUNC_SEARCH:DoSearch();break;caseFUNC_CHANGE:DoChange();break;caseFUNC_DELETE:DoDelete();break;caseFUNC_DISPLAY:DoDisplay();break;caseFUNC_CENSUS:Docensus();break;caseFUNC_CLOSE:DoExit();break;default:break;}}}intMainMenu(){intiUserSel
6、ect;system("cls");printf("---------------------------------------------------------------------");printf("
7、***********欢迎来到学生管理系统**********
8、");printf("
9、******1>新建学生信息******
10、");printf("
11、******2>保存学生信息******
12、");printf("
13、******3>打开学生信息******
14、");printf("
15、**
16、****4>插入学生信息******
17、");printf("
18、******5>查找学生信息******
19、");printf("
20、******6>修改学生信息******
21、");printf("
22、******7>删除学生信息******
23、");printf("
24、******8>展示学生信息的成绩排名******
25、");printf("
26、******9>分段统计学生信息******
27、");printf("
28、******10>退出学生系统******
29、");printf("
30、*****Please
31、selectafunctionid(1..9)toexecute:*****
32、");printf("---------------------------------------------------------------------");scanf("%d",&iUserSelect);if(iUserSelect<
此文档下载收益归作者所有