c++大作业学生信息管理系统源代码.doc

c++大作业学生信息管理系统源代码.doc

ID:48450022

大小:77.50 KB

页数:17页

时间:2020-01-30

c++大作业学生信息管理系统源代码.doc_第1页
c++大作业学生信息管理系统源代码.doc_第2页
c++大作业学生信息管理系统源代码.doc_第3页
c++大作业学生信息管理系统源代码.doc_第4页
c++大作业学生信息管理系统源代码.doc_第5页
资源描述:

《c++大作业学生信息管理系统源代码.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、.学生信息管理系统源代码:#include#include#include#include#include#includestructstudent{charnum[30];intmaths;charname[30];intchinese;charclas[30];intenglish;inttotal;floataverage;student*next;};//◆1(1)voidcreatelist(student*&head)//学生成绩文件导

2、入功能(用链表储存){chart[80],num0[30],name0[30],clas0[30];intchinese0,maths0,english0;student*s,*p;ifstreaminstuf("student-score.txt",ios::in);if(!instuf){cerr<<"filecouldnotbeopen."<>num0>>name0>>clas0>>chinese0>>maths0>>english0){s=newstudent;str

3、cpy(s->num,num0);strcpy(s->name,name0);strcpy(s->clas,clas0);s->chinese=chinese0;s->maths=maths0;s->english=english0;s->total=s->chinese+s->maths+s->english;s->average=float(s->total)/3;if(head==NULL)head=s;elsep->next=s;p=s;}p->next=NULL;instuf.close();word专业资料.}//◆1(2)voidshowlist(stude

4、nt*head)//学生成绩信息显示功能(遍历链表){intn=1;cout<<"学号姓名班级语文数学英语总分均分序号";while(head){cout<num<<""<name<<'t'<clas<<'t'<<""<chinese<<'t'<maths<<'t'<english<<'t'<total<<'t'<average<<'t'<<""<next;}}/

5、/◆2voidcharu(student*head)//学生成绩信息插入功能(链表尾部插入学生成绩信息){student*s,*p,*q;intn,i;cout<<"请输入需要【插入】的学生成绩信息的数量:";cin>>n;cout<<"请输入需插入的学生成绩信息(每人一行):"<next;}for(i=1;i<=n;i++){s=newstudent;cin>>s->num>>s->name>>s->clas>>s->chinese>>s->maths>>

6、s->english;s->total=s->chinese+s->maths+s->english;s->average=float(s->total)/3;q->next=s;q=s;}q->next=NULL;}word专业资料.//◆3voidshanchu(student*&head)//学生成绩信息删除功能{student*p,*q;chara[30];intn,i,b=1;cout<<"请输入需【删除】的学生成绩信息的数量:";cin>>n;cout<<"请输入需要删除的学生的学号或姓名:"<>a;if

7、((strcmp(head->num,a)==0)

8、

9、(strcmp(head->name,a)==0)){b=0;p=head;head=head->next;deletep;p=NULL;}else{p=head;while((p->next!=NULL)&&(strcmp(p->next->num,a)!=0)&&(strcmp(p->next->name,a)!=0)){p=p->next;}if(p->next!=NULL){b=0;q=p->next;p->next=q->next;deleteq;q=NULL;}

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。