#include<stdio.h>
int main(){
struct Student{
char name[20];
float score;
}stu[5]={{101011,"li ming",61},{101012,"zhang san",69},{101013,"wang wu",80},{101014,"li si",90},{101015,"wang cao",75}};
struct Student temp;
int i,j,k;
for(i=0;i<4;i++){
k = i;
for(j = i+1;j<5;j++){
if(stu[j].score>stu[k].score){
k = j;
}
}
temp = stu[k];
stu[k] = stu[i];
stu[i] = temp;
}
for(i = 0;i<5;i++){
printf("%d\t%s\t%f\n",stu[i].num,stu[i].name,stu[i].score);
}
return 0;
}
temp = stu[k];
stu[k] = stu[i];
stu[i] = temp;
这个是什么意思?不太理解