转置矩阵的编程问题
Dim a(1 To 8, 1 To 8) As Integer, b(1 To 8, 1 To 8) As IntegerPrivate Sub Command1_Click()
For i = 1 To 8
For j = 1 To 8
b(j, i) = GetArray(a(i, j))
Next
Next
Picture1.CurrentY = 80
For i = 1 To 8
For j = 1 To 8
Picture1.Print Format(b(i, j), "@@@");
Next
Picture1.Print
Picture1.Print
Next
End Sub
Private Sub Form_Activate()
Form_Load
End Sub
Private Sub Form_Load()
k = 0
For i = 1 To 8
For j = 1 To 8
a(i, j) = j + k
Next
k = k + 8
Next
Picture1.CurrentY = 80
For i = 1 To 8
For j = 1 To 8
Picture1.Print Format(a(i, j), "@@@");
Next
Picture1.Print
Picture1.Print
Next
End Sub
Private Function GetArray(m()) As Integer()
Dim L As Integer
Dim U As Integer
L = LBound(m())
U = UBound(m())
ReDim n(U, L)
For i = 1 To U
For j = 1 To L
n(j, i) = m(i, j)
Next
Next
GetArray = n
End Function
我写了个程序 但是在b(j, i) = GetArray(a(i, j))这句出错了 怎么改啊?
希望高手们就以我这个程序为框架,帮我改改!!