vb编程题:随机产生10个0~100的整数,单击窗体,在窗体上显示这10个数以及10个数中的最大值。

2024-11-25 21:54:54
推荐回答(3个)
回答1:

运行测试通过,希望对你有帮助。
Private Sub Command1_Click()
Dim a(9) As Integer
Dim i As Integer
Dim max As Integer
For i = 0 To 9
a(i) = Int(Rnd * 101)
Next i
max = a(0)
Print max
For i = 1 To 9
Print a(i)
If max <= a(i) Then
max = a(i)
End If
Next i
Print "最大的数是"; max
End Sub

回答2:

没分

回答3:

没分,刘明