[填空题] 已知数组A(4,4),各个元素在运行程序时被赋值并打印,形成四阶方阵。请在空白处填入所需的内容,使产生一个转置矩阵(即行列互换),仍放在数组A中,并打印出来。例如: 1 2 3 4 1
17 查阅
[填空题] 已知数组A(4,4),各个元素在运行程序时被赋值并打印,形成四阶方阵。请在空白处填入所需的内容,使产生一个转置矩阵(即行列互换),仍放在数组A中,并打印出来。例如:
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
Private Sub Command1_Click()
Dim a(4,4)
For k=1 To 4
For j=1 To 4
a(k,j)=j
Print a(k,j);
Next
Next
For k=2 To 4
For i=1 To (12)
t=a(j,k)
a(j,k)= (13)
a(k,j)=t
Next
Next
For k=1 To 4
Print a(k,1); a(k,2):a(k,3):a(k,4)
Next
End Sub
参考答案: