欢迎来到天天文库
浏览记录
ID:35418401
大小:57.74 KB
页数:6页
时间:2019-03-24
《用链表实现学生信息管理系统主程序文件》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、//tKrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwKvoidmain()handle_menul();//Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjw
2、rjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwJ/*菜单处理函数*///trjwrjw3、结果”);*/print(headl);break;case4:/*printf(Mt输出链表2的结果M);*/print(head2);break;case5:game3();/*调用删除模块*/break;case6:game4();/*调用插入模块*/break;case7:game5();/*调用查找模块*/break;case8:printf(nt再见!n);return;//<{><{><{><{><{><{><{><{><{><{><{>JJrjwrjwrjwrjwrjwrjwrjwrj4、wrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjw***//*菜单选择函数:intmemi_select()*//KKrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwintmenu_select()intcn;for(;;){printf(HM);printf(nn);printf(nn);printf(ntl.追加法建表j;prin5、tfC*弋2•插入法建表n);printf(nt3.输出链表lM);printf(Mt4.输出链表2M);printf(nt5.删除一个结点n);printf(nt6.插入一个结点j;printf(nt7.查找一个结点n);printf(nt8.退出程序n);printf(nt选择l-8:n);scanf(H%d*&cn);//gets(s);//cn=atoi(s);if(cn6、7、cn>8)printf(nt输入错误,重选elsebreak;returncn;/8、Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjw/*对链表插入操作*//*函数原型:voidgame4();*//*函数参数:void*//*函数返回值:void*/Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrj9、wrjwvoidgame4(){charch;STD*stud,*head=head1;system(HCLS'');printf(nt仅限在表1中插入!”);printf(Mt输入要插入结点的学号和姓名(以空格隔开):”);stud=(STD*)malloc(LEN);scanf(M%*cn);scanf(*'%d%sn,&stud->num,&stud->name);if(stud->num<0){printf(Mt输入的学号不能为负数,请重新选择插入!n);return;headl=insert(10、head,stud);printf(Mt输入回车键返回!");getchar();system(nCLSn);printf(Mn);/Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwr
3、结果”);*/print(headl);break;case4:/*printf(Mt输出链表2的结果M);*/print(head2);break;case5:game3();/*调用删除模块*/break;case6:game4();/*调用插入模块*/break;case7:game5();/*调用查找模块*/break;case8:printf(nt再见!n);return;//<{><{><{><{><{><{><{><{><{><{><{>JJrjwrjwrjwrjwrjwrjwrjwrj
4、wrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjw***//*菜单选择函数:intmemi_select()*//KKrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwintmenu_select()intcn;for(;;){printf(HM);printf(nn);printf(nn);printf(ntl.追加法建表j;prin
5、tfC*弋2•插入法建表n);printf(nt3.输出链表lM);printf(Mt4.输出链表2M);printf(nt5.删除一个结点n);printf(nt6.插入一个结点j;printf(nt7.查找一个结点n);printf(nt8.退出程序n);printf(nt选择l-8:n);scanf(H%d*&cn);//gets(s);//cn=atoi(s);if(cn6、7、cn>8)printf(nt输入错误,重选elsebreak;returncn;/8、Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjw/*对链表插入操作*//*函数原型:voidgame4();*//*函数参数:void*//*函数返回值:void*/Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrj9、wrjwvoidgame4(){charch;STD*stud,*head=head1;system(HCLS'');printf(nt仅限在表1中插入!”);printf(Mt输入要插入结点的学号和姓名(以空格隔开):”);stud=(STD*)malloc(LEN);scanf(M%*cn);scanf(*'%d%sn,&stud->num,&stud->name);if(stud->num<0){printf(Mt输入的学号不能为负数,请重新选择插入!n);return;headl=insert(10、head,stud);printf(Mt输入回车键返回!");getchar();system(nCLSn);printf(Mn);/Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwr
6、
7、cn>8)printf(nt输入错误,重选elsebreak;returncn;/
8、Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjw/*对链表插入操作*//*函数原型:voidgame4();*//*函数参数:void*//*函数返回值:void*/Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrj
9、wrjwvoidgame4(){charch;STD*stud,*head=head1;system(HCLS'');printf(nt仅限在表1中插入!”);printf(Mt输入要插入结点的学号和姓名(以空格隔开):”);stud=(STD*)malloc(LEN);scanf(M%*cn);scanf(*'%d%sn,&stud->num,&stud->name);if(stud->num<0){printf(Mt输入的学号不能为负数,请重新选择插入!n);return;headl=insert(
10、head,stud);printf(Mt输入回车键返回!");getchar();system(nCLSn);printf(Mn);/Krjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwrjwr
此文档下载收益归作者所有