}
//◆6
(1)
voidyuwen(student*head)//按语文成绩从高到低排序功能
{
student*p,*q;
chara[30];
intb;
floatc;
p=head;
while(p)
{
q=p->next;
while(q)
{
if(p->chinesechinese)
{
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;
}
}
//◆6
(2)
voidshuxue(student*head)//按数学成绩从高到低排序功能
{
student*p,*q;
chara[30];
intb;
floatc;
p=head;
while(p)
{
q=p->next;
while(q)
{
if(p->mathsmaths)
{
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;
}
}
//◆6(3)
voidyingyu(student*head)//按英语成绩从高到低排序功能
{
student*p,*q;
chara[30];
intb;
floatc;
p=head;
while(p)
{
q=p->next;
while(q)
{
if(p->englishenglish)
{
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;
}
}
//◆6(4)
voidzongfen(student*head)//按总分成绩从高到低排序功能
{
student*p,*q;
chara[30];
intb;
floatc;
p=head;
while(p)
{
q=p->next;
while(q)
{
if(p->totaltotal)
{
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;
}
}
//◆7
voidxuehao(student*head)//按学号从小到大排序功能
{
student*p,*q;
chara[30];
intb;
floatc;
p=head;
while(p)
{
q=p->next;
while(q)
{
if(strcmp(p->num,q->num)>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;
}
}
//◆8
voidxingming(student*head)//按姓名首字母排序功能
{
student*p,*q;
chara[30];
intb;
floatc;
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);
str