Dim a() As Integer, n As Integer
Private Sub Command1_Click()
n = InputBox("请输入n:")
ReDim a(n, n)
For i = 1 To n
For j = 1 To n
Randomize
a(i, j) = Int(Rnd * 90) + 10
Print a(i, j);
Next j
Print
Next i
End Sub
Private Sub Command2_Click()
For i = 1 To n
For j = 1 To n
If i + j = n + 1 Then
s = s + a(i, j)
End If
Next j
Next i
Text1.Text = s
End Sub
温馨提示:答案为网友推荐,仅供参考