( 24 )有以下程序:
Option Base 1
Dim arr() As Integer
Private Sub Form_Click()
Dim i As Integer, j As Integer
ReDim arr(3, 2)
For i = 1 To 3
For j = 1 To 2
arr(i, j) = i * 2 + j
Next j
Next i
ReDim Preserve arr(3, 4)
For j = 3 To 4
arr(3, j) = j + 9
Next j
Print arr(3, 2); arr(3, 4)
End Sub
程序运行后,单击窗体,输出结果为
A ) 8 13
B ) 0 13
C ) 7 12
D ) 0 0
第1题:
● 若二维数组arr[1..M, 1..N]的首地址为base,数组元素按列存储且每个元素占用K个存储单元,则元素arr[i, j]在该数组空间的地址为 __ 。
A.base+((i-1)*M+j-1)*K
B.base+((i-1)*N+j-1)*K
C. base+((j-1)*M+i-1)*K
D. base+((j-1)*N+i-1)*K
第2题:
在窗体上画一个命令按钮,然后编写如下程序: Option Base 1 Private Sub Command1 Click() Dim Arr1(12)As Integer, Arr2(3)As Integer Dim Sum As Integer Sum = 2 For i=1 To 12 Arrl(i)= i Next i For i=1 To 3 Arr2(i)= Arrl(i*i) Next i For i = 1 To 3 Sum = Sum + Arr2(i) Next i Print Sum End Sub 程序运行后,单击命令按钮,在窗体上的输出结果为
A.16
B.24
C.32
D.36
第3题:
第4题:
● 若二维数组arr[1..M,1..N]的首地址为base,数组元素按列存储且每个元素占用K个存储单元,则元素arr[i,j]在该数组空间的地址为 (21) 。
A.base+((i-1)*M+j-i)*K
B.base+((i-1)*N+j-1)*K
C.base+((j-1)*M+i-1)*K
D.base+((j-1)*N+i-1)*K
第5题: