`include
struct struct_name
{
char name[20];
char num[20];
float score;
}student[3];
void sort(struct struct_name *p)
{ struct struct_name temp,*p1; int i, j;
printf("lololololol");
for(i=0;i for(j=0;j if(p->score<(p+1)->score){
temp=*p;
*p=*p1;
*p1=temp;
}
p++;
}
}
}
int main()
{
struct_name student [3]={{"Tom","15",97.2},{"Boy","16",98.1},{"Smith","18",99.0}};
sort(student);
int i;
for(i=0;i<3;i++){
printf("姓名:%s\n学号:%s\n成绩:%.1f\n",student[i].name,student[i].num,student[i].score);
}
return 0;
}