VB中怎么求一个二维数组的最大值。求简单代码。
1个回答
推荐于2017-05-24
展开全部
Private Sub Command1_Click()
Dim max
Randomize
Dim a(1 To 3, 1 To 3)
max = 0
For i = 1 To 3
For j = 1 To 3
a(i, j) = Int(Rnd * 101)
Print a(i, j);
Next j, i
Print
For i = 1 To 3
For j = 1 To 3
If a(i, j) > max Then max = a(i, j)
Next j, i
Print max
End Sub
Dim max
Randomize
Dim a(1 To 3, 1 To 3)
max = 0
For i = 1 To 3
For j = 1 To 3
a(i, j) = Int(Rnd * 101)
Print a(i, j);
Next j, i
For i = 1 To 3
For j = 1 To 3
If a(i, j) > max Then max = a(i, j)
Next j, i
Print max
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询