问题详情

答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关

试题1本题程序的功能是从键盘上输入若干个学生的成绩,统计并输出最高成绩和最低成绩,当输入负数


试题1

本题程序的功能是从键盘上输入若干个学生的成绩,统计并输出最高成绩和最低成绩,当输入负数时结束输入。请将下述程序补充完整。(注意:不改动程序的结构,不得增行或删行。)

main()

{ float x,amax,amin;

scanf(“%f”,&x);

amax=x;

amin=x;

while(【1】)

{ if(x>amax) amax=x;

if(【2】) amin=x;

scanf(“%f”,&x);

}

printf(“ amax=%f amin=%f ”,amax,amin) ;

}

参考答案
您可能感兴趣的试题