题型:综合题 题类:常考题 难易度:普通
浙江省杭州市西湖高级中学2018-2019学年高二下学期信息技术4月月考试卷
Const n = 20
Dim a(1 To n) As Integer
Private Sub Command1_Click()
Dim i As Integer
Randomize
For i = 1 To n
a(i) = Int(Rnd * 1000) + 1
List1.AddItem Str(a(i))
Next i
End Sub
Private Sub Command2_Click()
Dim i As Integer, max As Integer
Dim min As Integer, sum As Single
max = a(1): min = a(1)
sum = 0
For i = 2 To n
If Then max = a(i)
If a(i) < min Then min = a(i)
sum = sum + a(i)
Next i
Text1.Text = Str(max)
Text2.Text = Str(min)
Text3.Text = Str(sum)
End Sub
试题篮