(21)下面正确使用动态数组的是
A)Dim arr() As Integer
…
ReDim arr(3,5)
B)Dim arr() As Integer
…
ReDim arr(50)As String
C)Dim arr()
…
ReDim arr(50) As Integer
D)Dim arr(50) As Integer
…
ReDim arr(20)
(22)下面是求最大公约数的函数的首部
Function gcd(ByVal x As Integer, ByVal y As Integer) As Integer
若要输出8、12、16这3个数的最大公约数,下面正确的语句是
A)Print gcd(8,12),gcd(12,16),gcd(16,8)
B)Print gcd(8,12,16)
C)Print gcd(8),gcd(12),gcd(16)
D)Print gcd(8,gcd(12,16))
(23)有下面的程序段,其功能是按图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)For i=1 To 5
For j=1 To 3
Print a(j,i);
Next
Print
Next
B)For i=1 To 3
For j=1 To 5
Print a(j,i);
Next
Print
Next
C)For j=1 To 5
For i=1 To 3
Print a(j,i);
Next
Print
Next
D)For i=1 To 5
For j=1 To 3
Print a(i,j);
Next
Print
Next