热门

最新

红包

立Flag

投票

同城

我的

发布
qq_42322611
小呆子lazy
4 年前
trueqq_42322611

这

CSDN App 扫码分享
分享
3
3
打赏
  • 复制链接
  • 举报
下一条:
这个冒泡法有错误吗?怎么倒不过来? int f,j; float a,b; char c[100],x[100],y[100],z[100]; for(i=0; i<n-1;++i) { for(j=0;j<n-1-i;++j) { if(stu[j].Score<stu[j+1].Score) { strcpy(x,stu[j].StudentName);strcpy(stu[j].StudentName,stu[j+1].StudentName);strcpy(stu[j+1].StudentName,x); } } } printf("学生学号 \t学生姓名 \t年龄 \t性别 \t民族 \tC语言成绩 \t高数成绩\n"); for(i=0; i<n; ++i) { printf("------------------------------------------------------------------------------\n"); printf("%s \t %s \t %d \t%s \t %s \t %.1f \t %.lf\n", stu[i].StudentId, stu[i].StudentName, stu[i].StudentAge, stu[i].StudentSex, stu[i].StudentNation,stu[i].StudentScore[0],stu[i].StudentScore[1]); }
立即登录