忆知数组A(4,4),各个元素在运行程序时被赋值并打印,形成四除非方阵。请在【】和【】处填处所需的内容,
17 查阅
忆知数组A(4,4),各个元素在运行程序时被赋值并打印,形成四除非方阵。请在【 】和【 】处填处所需的内容,使产生一个转置矩阵(即行列互换),仍放在数组A中,并打印出来。例如:
1 2 3 4
1 2 3 4
1 2 3 4
l 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 j=1 To【 】
t=a(j,k)
a(j,k)=【 】
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
参考答案: