为什么运行不出结果,代码有什么问题吗


#include
struct student{
  int sno;
  char name[10];
  float score;
};
int main()
{
  int a,j,i;
    struct student stu[5]={{10101,"Zhang",78},{10103,"Wang",98.5},{10106,"Li",86},{10108,"Ling",73.5},{10110,"Fun",100}};
    struct student steam;
    for(i=0;i<5;i++){
      for(j=0;j<5-i;j++){
        if(stu[j].score>stu[j+1].score){
          steam=stu[j+1];
          stu[j+1]=stu[j];
          stu[j]=steam;
      }
    }
  }
  for(a=4;a>=0;a--)
  printf("%d%s%0.2f\n",stu[a].sno,stu[a].name,stu[a].score);
  return 0;
}

img

img

for(j=0;j<5-i;j++){
改为
for(j=0;j<4-i;j++){