if (max != p)
{
temp = max->sum;max->sum = p->sum;p->sum = temp;
temp1=max->num;max->num=p->num;p->num=temp1;
strcpy(temp2,max->name);strcpy(max->name,p->name);strcpy(p->name,temp2);
temp3=max->year;max->year=p->year;p->year=temp3;
temp4=max->month;max->month=p->month;p->month=temp4;
temp5=max->day;max->day=p->day;p->day=temp5;
temp6=max->c;max->c=p->c;p->c=temp6;
temp7=max->math;max->math=p->math;p->math=temp7;
temp8=max->eng;max->eng=p->eng;p->eng=temp8;
strcpy(temp9,max->sex);strcpy(max->sex,p->sex);strcpy(p->sex,temp9);
}
p = p->next;
这代码写的又臭又长,定义了一大堆只用一次的变量
其实目的不过就是交换max和p的值