第2个回答 2007-06-11
只要定义一个command1控件就可以了:
Private Sub Command1_Click()
Dim a(4, 4) As Integer, i%, j%, sum
sum = 0
Randomize
For i = 0 To 4
For j = 0 To 4
a(i, j) = (Rnd * 100) + 1
Print a(i, j); " ";
Next j
Print
Next i
For i = 1 To 3
For j = 1 To 3
sum = sum + a(i, j)
Next j, i
Print "sum:"; sum
End Sub本回答被提问者采纳