c++大作业学生信息管理系统源代码(11)
时间:2025-03-10
时间:2025-03-10
c++大作业学生信息管理系统源代码
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;
}
}
//◆8
void xingming(student *head) //按姓名首字母排序功能
{
student *p,*q;
char a[30];
int b;
float c;
p=head;
while (p)
{
q=p->next;
while (q)
{
if (strcmp(p->name,q->name)>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;
}
q=q->next;
}
p=p->next;
}
}
//◆9
void banji(student *head) //按班级的类别排序功能
{ c=p->average;p->average=q->average;q->average=c;
上一篇:李君如谈建设学习型党组织