填空题
以下程序的功能是,从键盘上输入若干数据,统计并输出最大值和最小值,当输入负数时结束输入,请填空。
Dim amax As Single,amin As Single
x=InputBox("请输入数据")
amax=x
amin=x
Do While
【8】
If x>amax Then
amax=x
End If
If
【9】
Then
amin=x
End If
x=InputBox("请输入数据")
Loop
Print "Max=";amax;"Min=";amin
End Sub
【参考答案】
[8]x>=0或Not x<0
[9]x<amin或Not x>=amin
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
窗体上有4个文本框控件数组text1()和一个命令按钮,程序运行前如左图所示,程序运行后如右图所示。给定的程序不完整,将程序补充完整。 Dim x(3)As Integer Private Sub Command1_Click () For i = 0 To 3 x(i)= 【10】 Next i For i = 0 To UBound(x)- 1 For j = i To UBound(x) If 【11】 Then t = x(i) x(i)= x(j) x(j)= t End If Next j Next i For i = 0 To 3 Text1(i) .Text = Str(x(i)) Next i End Sub
点击查看答案&解析
填空题
窗体上有一个命令按钮,数据文件data.txt的内容如下: 语文 2001 , 87 数学 2002 , 75 英语 2003 , 92 体育 2004 , 66 Type bs aa As String * 2 bb As String * 4 cc As Integer End Type Private Sub command1_Click( Dim xs As bs Dim fl As Integer fl = FreeFile Open d: data.txt For Input As #fl Do While Not EOF(fl) Input #fl, xs. aa, xs .bb, xs.cc List1.AddItem xs.bb List1.AddItem xs.aa List1.AddItem xs.cc Loop Print EOF(fl) Close End Sub 问:在列表框中第一行、第三行、第四行的内容是 【12】 、 【13】 、 【14】 。窗体上打印出的是 【15】 。
点击查看答案&解析
相关试题
在结构化程序设计的原则中,“先考虑总体,...
为了使一个标签透明且没有边框,必须将它的...