单选题 VB
题号 #2272662

有下面的程序段,其功能是按图1所示的规律输出数据:
Dim a(3,5)As Integer For i=1 To 3
For j=1 To 5
a(i,j)=i+j
Print a(i,j);
Next
Print
Next

若要按图2所示的规律继续输出数据,则接在上述程序段后面的程序段应该是(  )。

进入在线模考

参考答案

A

答案解析

A。【解析】本题是要得出矩阵的倒置,首先本题定义了一个3行5列的矩阵,转换完成后要变成5行3列,把原来的行元素变成后来的列元素,所以先输出j,再输出i。故本题答案为A选项。

你可能感兴趣的试题

A.Private Sub P1 MouseMove(Button As Integer,Shift As Integer,X As Single,Y
As Single)
Print X Y
End Sub
B.Private Sub P1 MouseDown(Button As Integer,Shift As Integer,X As Single,Y
As Single)
Picture.Print X,Y
End Sub
C.Private Sub P1 MouseMove(Button As Integer,Shift As Integer,X As Single,Y
As Single)
P1.Print X,Y
End Sub
D.Private Sub Form MouseMove(Button As Integer,Shift As Integer,X As Single,Y
As Single)
P1.Print X,Y
End Sub
找试题 · 找答案 · 找资料 在线模考