填空题 以下程序的功能是,从键盘上输入若干学生的成绩,统计并输出最高分数和最低分数,当输入负数时结束输入,请填空。 Private Sub Command1_C1iek() Dim x As Single Dim amax As Single,amln As Single x=InputBox("请输入分数") amax=x amin=x Do While{{U}} 【8】 {{/U}} If x>amax Then amax=x End If If{{U}} 【9】 {{/U}}Then amin=x End If x=InputBox("请输入分数") Loop Print amax,amin End Sub
  • 1、
【正确答案】 1、[8] x>=0或Not x<0    
【答案解析】[9] x<amin或Not x>=amin [解析] 本题主要是对求最值算法的考查。题中要求当输入负数时结束输入,可知控制程序的条件应是输人数x必须大于等于0。用语句表示应为x>=0或Not x<0。程序中用变量amin存放最低分,又因为语句amin= x,则可推断出x值比初始化时的最低分要小的条件。故条件表达式应写成x<amin或 Not x>=amin。