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

时间:2025-03-10

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文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219