手机版

c++大作业学生信息管理系统源代码(12)

时间:2025-07-07   来源:未知    
字号:

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

student *p,*q;

char a[30];

int b;

float c;

p=head;

while (p)

{

q=p->next;

while (q)

{

if (strcmp(p->clas,q->clas)>0)

{

strcpy(a,p->num);strcpy(p->num,q->num);strcpy(q->num,a);

strcpy(a,p->name);strcpy(p->name,q->name);strcpy(q->name,a);

strcpy(a,p->clas);strcpy(p->clas,q->clas);strcpy(q->clas,a);

b=p->chinese;p->chinese=q->chinese;q->chinese=b;

b=p->maths;p->maths=q->maths;q->maths=b;

b=p->english;p->english=q->english;q->english=b;

b=p->total;p->total=q->total;q->total=b;

c=p->average;p->average=q->average;q->average=c;

}

q=q->next;

}

p=p->next;

}

}

//◆10

void show(student *head,char *s) //学生成绩信息文件导出功能

{

int n=1;

ofstream outstuf;

outstuf.open(s,ios::out);

if (!outstuf) {cerr<<"file could not be open."<<endl; abort();}

outstuf<<"学号 姓名 班级 语文 数学 英语 总分 均分

while (head)

{

outstuf<<head->num<<" "<<head->name<<'\t'<<head->clas<<'\t'<<" "<<head->chinese<<'\t'

<<head->maths<<'\t'<<head->english<<'\t'<<head->total<<'\t'

<<setprecision(3)<<head->average<<'\t'<<" "<<n<<endl;

n=n+1;

head=head->next; 序号"<<endl;

c++大作业学生信息管理系统源代码(12).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)