Private Sub Command1_Click() Dim x(1 To 10) As Integer, Max As Integer, i As Integer For i = 1 To 10 x(i) = Int(Rnd * 100) Print x(i); Next i Print Max = x(1) For i = 2 To 10 If x(i) > Max Then Max = x(i) End If Next i Text1.Text = "最大值为" & Max End Sub