教务管理系统C语言代码

上传人:cl****1 文档编号:498081316 上传时间:2023-09-16 格式:DOCX 页数:7 大小:13.67KB
返回 下载 相关 举报
教务管理系统C语言代码_第1页
第1页 / 共7页
教务管理系统C语言代码_第2页
第2页 / 共7页
教务管理系统C语言代码_第3页
第3页 / 共7页
教务管理系统C语言代码_第4页
第4页 / 共7页
教务管理系统C语言代码_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《教务管理系统C语言代码》由会员分享,可在线阅读,更多相关《教务管理系统C语言代码(7页珍藏版)》请在金锄头文库上搜索。

1、.#include#include#include#include#include using namespace std;void change()( int exit()(return 0;/3 “/*“ 个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个int menu()(system(cls);int n=1,select=-1;coutendlendlendl;coutsetw(68)CSU学生档案管理系统*C*S*U*endlendl;coutsetw(26)n+coutsetw(26)n+coutsetw(26)n+coutset

2、w(26)n+coutsetw(26)n+输入学生信息显示学生信息删除学生信息添加学生信息修改学生信息 1endlendl; 2endlendl;3endlendl;4endlendl; 5endlendl;coutsetw(63) 0*退出 *0endlendlendl;coutsetw(36)select;if(select5)(cout非法数据!请重新输入:endl;system(pause);select=menu();return select;/*“ 个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个 void append()syste

3、m(cls);struct studentlong int number;char name100;float score;student st;int i,n;ofstream outfile(info.txt”,ios:out|ios:app);if(!outfile)couterror;return;coutn;for(i=0;in;i+)coutst.number;coutst.name;coutst.score;coutendlendl;outfile.write(char*)&st,sizeof(st);outfile.close();/*“ 个个个个个个个个个个个个个个个个个个个

4、个个个个个个个个个个个个个个个个个个个个个个个个个个个void dele()long int deleteNumber;int n=0;coutdeleteNumber;fstream fileNumber(number.txt”,ios:inlios:out);fstream fileNumber2(number.txt”,ios:in|ios:out);fstream fileName(name.txt”,ios:in|ios:out);fstream fileName2(name.txt”,ios:in|ios:out);fstream fileScore(score.txt”,ios:

5、in|ios:out);fstream fileScore2(score.txt”,ios:in|ios:out);fstream studentNumber(studentNumber.txt”,ios:in|ios:out);fstream studentNumber2(studentNumber.txt”,ios:in|ios:out);if(!fileNumber)|(!fileNumber2)|(!fileName)|(!fileName2)|(!fileScore)|(!fileScore2)|(!studentNumber)|(!studentNumber2)(coutn;lon

6、g int *num=new long intn;long int *num2=new long intn;string *name=new stringn;string *name2=new stringn;int *score=new intn;int *score2=new intn;bool find=false;int m=0;for(int i=0;inum2i;fileNamename2i;fileScorescore2i;coutname2i;if(num2i!=deleteNumber)numm=num2i;namem=name2i;scorem=score2i;m+;els

7、e(find=true;coutsetw(20)删除成功endlendl;if(find=false)cout找不到该学号!请重新输入! endl;system(pause);fileNumber.close();fileNumber2.close();fileName.close();fileName2.close();fileScore.close();fileScore2.close();studentNumber.close();studentNumber2.close();return;n-;studentNumber2n;for(int j=0;jn;j+)fileNumber2n

8、umj;fileName2namej;fileScore2scorejn;student *stu=new student n;/* if(!infileName)|(!infileNumber)|(!infileScore)( cout打开文件错误!”;system(pause);return;/3 “/* system(cls);coutNumbersetw(28)Namesetw(28)Scoreendl;for(int i=0;istui.number;infileNamestui.name;infileScorestui.score;coutstui.numbersetw(30)st

9、ui.namesetw(30)stui.scoreendl; infileNumber.close();infileName.close();infileScore.close();studentNumber.close();system(pause);/*“ 个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个个void input()(int n;ofstream outfileNumber(number.txt”,ios:out);ofstream outfileName(name.txt”,ios:out);ofstream outfileScore(score.txt”,ios:out);ofstream studentNumber(studentNumber.txt”,ios:out);if(!outfileName)|(!outfileNumber)|(!outfileScore)|(!studentNumber)(cout打开文件错误!”;system(pause);return;system(cls);coutn;student

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号