第1个回答 2009-04-23
试试吧
Private Sub Form_Click()
Dim a(3, 4) As Integer
Dim max As Integer, maxi As Integer, maxj As Integer
Dim min As Integer, mini As Integer, minj As Integer
'产生随机数
For i = 1 To 3
For j = 1 To 4
Randomize
a(i, j) = Int(Rnd * 100)
Print a(i, j);
Next
Print
Next
'最大,最小值
max = a(1, 1)
min = a(1, 1)
For i = 1 To 3
For j = 1 To 4
If max < a(i, j) Then max = a(i, j): maxi = i: maxj = j
If min > a(i, j) Then min = a(i, j): mini = i: minj = j
Next
Next
Print "最大值:" & max & ",行号:" & maxi & ",列号" & maxj
Print "最小值:" & min & ",行号:" & mini & ",列号" & minj
End Sub本回答被提问者采纳