Private Sub Command1_Click()
Dim a(4, 2) As Integer, b(2, 4) As Integer
Dim i As Integer, j As Integer
Dim tmp1 As String, tmp2 As String
Randomize Timer
For i = 0 To 4
For j = 0 To 2
a(i, j) = Int(Rnd * 10)
tmp1 = tmp1 & Str(a(i, j))
Next
tmp1 = tmp1 & vbCrLf
Next
For i = 0 To 2
For j = 0 To 4
b(i, j) = a(j, i)
tmp2 = tmp2 & Str(b(i, j))
Next
tmp2 = tmp2 & vbCrLf
Next
Print "原随机矩阵为:"
Print tmp1
Print "转置后矩阵为:"
Print tmp2
End Sub