将3*3的矩阵转置我编了个程序Private Sub Form_click()Dim a(1 To 3,1 To 3),i As Byte,j As Byte,t As ByteFor i = 1 To 3For j = 1 To 3a(i,j) = Val(InputBox("a(" & i & "," & j & ")=?"))Next jNext iFor i = 2 To 3For j = 1 To i - 1t = a(i,j):

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 06:01:14
将3*3的矩阵转置我编了个程序Private Sub Form_click()Dim a(1 To 3,1 To 3),i As Byte,j As Byte,t As ByteFor i = 1 To 3For j = 1 To 3a(i,j) = Val(InputBox(
x){XW5{1iOv=ٱ2KRKrs254]2s5 Bu NcSeINUcu+d**@xYp^FN&WPZ_~OPbikZQ&3aa`XAlI*'`,Iz@\( UpkbkaF 0+5t2A|a~6j5i`Its]R@f?ٱ';;^}06_l}] \g> ٌf @w$M`7

将3*3的矩阵转置我编了个程序Private Sub Form_click()Dim a(1 To 3,1 To 3),i As Byte,j As Byte,t As ByteFor i = 1 To 3For j = 1 To 3a(i,j) = Val(InputBox("a(" & i & "," & j & ")=?"))Next jNext iFor i = 2 To 3For j = 1 To i - 1t = a(i,j):
将3*3的矩阵转置我编了个程序
Private Sub Form_click()
Dim a(1 To 3,1 To 3),i As Byte,j As Byte,t As Byte
For i = 1 To 3
For j = 1 To 3
a(i,j) = Val(InputBox("a(" & i & "," & j & ")=?"))
Next j
Next i
For i = 2 To 3
For j = 1 To i - 1
t = a(i,j):a(i,j) = a(j,i):a(j,i) = t
Next j
Next i
For i = 1 To 3
For j = 1 To 3
Print a(j,i);
Next j
Print
Next i
End Sub
为什么输出的还是原来的矩阵,没有转置呢?

将3*3的矩阵转置我编了个程序Private Sub Form_click()Dim a(1 To 3,1 To 3),i As Byte,j As Byte,t As ByteFor i = 1 To 3For j = 1 To 3a(i,j) = Val(InputBox("a(" & i & "," & j & ")=?"))Next jNext iFor i = 2 To 3For j = 1 To i - 1t = a(i,j):
因为你输出时又转置了一下……
For i = 1 To 3
For j = 1 To 3
Print a(j,i);'