欢迎来到天天文库
浏览记录
ID:44659965
大小:154.29 KB
页数:7页
时间:2019-10-24
《读程序-成绩管理》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、读程序•成绩管理制作菜单voidpage_title声明stdiostdlibconio定义结构体数组structSTUDENT丿退出编辑基本信息voidstudent_edit任意键返回指令voidreturnconfir录入新信息voidstudent_new丿Id搜索intsearchidVoidstudent_delv成绩录入voidscore」nput成绩修改voidscoreedityMain丄函数/*学生成绩管理*//♦BorlandC下编译通过,调试过程中不要输入人数字*/#includc#include^include2、o.h>intINDEX[32]:structSTUDENT{intid,age,chinese,math,english;charname[21]:)students[32];voidpagetitle(char*menuitem){clrscr();printf(,z>»学生管理系统«<-%s-"』enu_item);}voidreturn_confirm(void){printf("按任意键返回");getch();}voidstudentnew(void){intn;page_titlc("录入学生丛木信息");for(n-0;n<32;n++)if(3、students[n].id二二0)break;printff^O;scanf("%d",&students[n]・id);printf("姓名secinf(”%s",&students!n].name);printfC年龄:");scanf("%d",&students[n].age);return_confirm();}intsearch_id(void){intn,i;printf(-请输入学生学号sctinf&i);for(n=0;n<32;n++){if(students[n].id==i&&students[n].id!=0){printf(,z学号:%d",stud4、ents!n].id);printf(z,姓名:%s",students[n].name);printf("年龄:%d",students[n].age);returnn;}}printfOn输入错误或学号不存在.〃);returnT;}voidstudent_del(void)intn;Page_titlc("注销学生基本信息“);if((n=search_id())!=-l)studentsfn].id=O;printfOn!该学生已注销.〃);returnconfirm();}voidstudent_edit(void){intn;page_title(^编辑学5、牛基本信息");if((n=search_id())!=-l){printf(〃请重新输入新信息:学号:“);scanf("%d",&students[n].id);printfC姓名scanf("%s",&studcnts[n].name);printfC年龄scanf&students[n].age);}return_confirm();}voidscorc_input(void)ints,n,t;page_titleC录入成绩");printfC请用数字键选择科目l语文2数学3英语");scanf("%d”,&s);for(n二0;n〈32;n++){if(6、students[n].id!=0){printfC学号:%d姓名:%s成绩:",students[n].id,students[n].name);sctinf("%d",&t);switch(s){case1:students[n].chinese=t;break;case2:students[n].math=t;break:ctise3:students!n].english=t;bretik;}}}return_confirm();}voidscore_edit(void){intn;page_title(“修改成绩");if((“searchid())!=-l){printf7、C语文:%d数学:%d英语:%d〃,students[n]・Chinese,students[n]・mtilh,students[n]・english);printf("请重新输入成绩:语文:”);seanf(&students[n]・chinese);printfC数学:");scanf("%s:^students[n].math);printf(”英语:");scanf(“%&students[n]・english);}return_con
2、o.h>intINDEX[32]:structSTUDENT{intid,age,chinese,math,english;charname[21]:)students[32];voidpagetitle(char*menuitem){clrscr();printf(,z>»学生管理系统«<-%s-"』enu_item);}voidreturn_confirm(void){printf("按任意键返回");getch();}voidstudentnew(void){intn;page_titlc("录入学生丛木信息");for(n-0;n<32;n++)if(
3、students[n].id二二0)break;printff^O;scanf("%d",&students[n]・id);printf("姓名secinf(”%s",&students!n].name);printfC年龄:");scanf("%d",&students[n].age);return_confirm();}intsearch_id(void){intn,i;printf(-请输入学生学号sctinf&i);for(n=0;n<32;n++){if(students[n].id==i&&students[n].id!=0){printf(,z学号:%d",stud
4、ents!n].id);printf(z,姓名:%s",students[n].name);printf("年龄:%d",students[n].age);returnn;}}printfOn输入错误或学号不存在.〃);returnT;}voidstudent_del(void)intn;Page_titlc("注销学生基本信息“);if((n=search_id())!=-l)studentsfn].id=O;printfOn!该学生已注销.〃);returnconfirm();}voidstudent_edit(void){intn;page_title(^编辑学
5、牛基本信息");if((n=search_id())!=-l){printf(〃请重新输入新信息:学号:“);scanf("%d",&students[n].id);printfC姓名scanf("%s",&studcnts[n].name);printfC年龄scanf&students[n].age);}return_confirm();}voidscorc_input(void)ints,n,t;page_titleC录入成绩");printfC请用数字键选择科目l语文2数学3英语");scanf("%d”,&s);for(n二0;n〈32;n++){if(
6、students[n].id!=0){printfC学号:%d姓名:%s成绩:",students[n].id,students[n].name);sctinf("%d",&t);switch(s){case1:students[n].chinese=t;break;case2:students[n].math=t;break:ctise3:students!n].english=t;bretik;}}}return_confirm();}voidscore_edit(void){intn;page_title(“修改成绩");if((“searchid())!=-l){printf
7、C语文:%d数学:%d英语:%d〃,students[n]・Chinese,students[n]・mtilh,students[n]・english);printf("请重新输入成绩:语文:”);seanf(&students[n]・chinese);printfC数学:");scanf("%s:^students[n].math);printf(”英语:");scanf(“%&students[n]・english);}return_con
此文档下载收益归作者所有