添加2个command控件
Dim a(5,5) As Integer
Private Sub Command1_Click()
For i = 1 To 5
For j = 1 To 5
Randomize
a(i,j) = Int(Rnd * 90) + 10
Print a(i,j);
Next j
Next i
End Sub
Private Sub Command2_Click()
Max = a(1,1)
m = 1
n = 1
For i = 1 To 5
For j = 1 To 5
If Max < a(i,j) Then
Max = a(i,j)
m = i
n = j
End If
Next j
Next i
Print "最大值为第" & m & "行,第" & n & "列的:" & Max
End Su