1个回答
展开全部
Private Sub Command1_Click()
Dim a() As Integer
m = InputBox("请输入行数m:")
n = InputBox("请输入列数n:")
ReDim a(m, n)
For i = 1 To m
For j = 1 To n
a(i, j) = InputBox("请输入a(" & i & "," & j & ")")
Print a(i, j);
Next j
Print
Next i
Max = a(1, 1)
For i = 1 To m
For j = 1 To n
If Max < a(i, j) Then
Max = a(i, j)
x = i
y = j
End If
Next j
Next i
Print
Print "最大值为" & Max & "在第" & x & "行" & y & "列"
End Sub
Dim a() As Integer
m = InputBox("请输入行数m:")
n = InputBox("请输入列数n:")
ReDim a(m, n)
For i = 1 To m
For j = 1 To n
a(i, j) = InputBox("请输入a(" & i & "," & j & ")")
Print a(i, j);
Next j
Next i
Max = a(1, 1)
For i = 1 To m
For j = 1 To n
If Max < a(i, j) Then
Max = a(i, j)
x = i
y = j
End If
Next j
Next i
Print "最大值为" & Max & "在第" & x & "行" & y & "列"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询