3个回答
展开全部
Private Sub Command1_Click()
Dim i%, j%
Randomize
For i = 0 To 5
For j = 0 To 6
arr(i, j) = Int(Rnd * 90 + 10)
Next
Next
Label1.Caption = "二维数组如下:"
For i = 0 To 5
Label1.Caption = Label1.Caption & vbCrLf
For j = 0 To 6
Label1.Caption = Label1.Caption & arr(i, j) & Space(2)
Next
Next
End Sub
Private Sub Command2_Click()
Dim max%, t
max = arr(0, 0)
For Each t In arr
If max < t Then
max = t
End If
Next
Label2 = "最大值为:" & max
End Sub
Private Sub Command3_Click()
End
End Sub
Dim i%, j%
Randomize
For i = 0 To 5
For j = 0 To 6
arr(i, j) = Int(Rnd * 90 + 10)
Next
Next
Label1.Caption = "二维数组如下:"
For i = 0 To 5
Label1.Caption = Label1.Caption & vbCrLf
For j = 0 To 6
Label1.Caption = Label1.Caption & arr(i, j) & Space(2)
Next
Next
End Sub
Private Sub Command2_Click()
Dim max%, t
max = arr(0, 0)
For Each t In arr
If max < t Then
max = t
End If
Next
Label2 = "最大值为:" & max
End Sub
Private Sub Command3_Click()
End
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询