如果说,将代码中while循环中的for循环中参数的s改成c会怎么样为什么
程序代码:
//输出学生信息要求从大到小 #include<stdio.h> #define miun 5 int main() { struct stend { char name[20]; int strd; float v; }vs[miun] = { {"李楠",10001,78.4},{"张敏",10002,98.5},{"刘晓丽",10003,89.3},{"美琪",10004,60.2},{"美雪",10005,99} }; struct stend sm; printf("成绩排行\n"); int s=0, c=0, f=0,ss; while (s < miun) { ss = s; for (c=s+1; c < miun; c++) //c=s+1改成c=c+1; { if (vs[s].v < vs[c].v) ss = c; sm = vs[ss]; vs[ss] = vs[s]; vs[s] = sm; } s++; } while (f < miun) { printf("名字:%s\t学号:%d\t成绩:%3.2f\n", vs[f].name, vs[f].strd, vs[f].v); f++; } }