红皮书_C语言程序设计实用教程参考答案(10)
发布时间:2021-06-07
发布时间:2021-06-07
printf("第%d次排序结果:a=%d,b=%d,c=%d,d=%d\n",count,a,b,c,d); }
if(a>d) { temp = a; a = d; d = temp; count++; printf("第%d次排序结果:a=%d,b=%d,c=%d,d=%d\n",count,a,b,c,d); } if(b>c) { temp = b; b = c; c = temp; count++; printf("第%d次排序结果:a=%d,b=%d,c=%d,d=%d\n",count,a,b,c,d); } if(b>d) { temp = b; b = d; d = temp; count++; printf("第%d次排序结果:a=%d,b=%d,c=%d,d=%d\n",count,a,b,c,d); } if(c>d) { temp = c; c = d; d = temp; count++; printf("第%d次排序结果:a=%d,b=%d,c=%d,d=%d\n",count,a,b,c,d); } if(count == 0) { printf("a=%d,b=%d,c=%d,d=%d\n",a,b,c,d); } return 0; } 7.
#include <stdio.h> int main(){ int score; printf("输入学生成绩的值(1~100之间),用空格或回车分隔:"); scanf("%d",&score); if(score>=90) {