1、一、单选题1、下面语句正确的是( )。A.Dim a( ) As Integer = 12B.Dim a( ) As Integer = 0C.Dim a(1) As Integer = 12D.Dim a(1) As Integer = 12, 12答案:A2、下列程序执行后,a(n) 与b(n) 结果为( )。Dim a(10), b(10) As Integern = 3For i = 1 To 5a(i) = ib(n) = 2 * n + iNext iA.13 4B.3 11C.2 33D.1 13答案:B3、在窗体模块中,定义模块级数组用( )语句。A.ReDimB.Static
2、C.PublicD.Dim答案:D4、执行以下程序时,则输出结果为( )。Dim a() = 1, 3, 5, 7, b(4) , i As IntegerFor i = 0 To 2b(3 - i) = a(i + 1)Next iMsgBox(b(i)A.1B.5C.3D.0答案:C5、下列程序执行后,s的值为( )。 Dim i%, j%, s% Dim a% = 1, 2, 3, 4 j = 1 For i = 3 To 0 Step -1 s = s + a(i) * j j = j * 10 Next iA.34B.1234C.12D.4321答案:B1、在程序运行过程中,单击窗体
3、时,以下程序的输出结果为( )。 Private Sub Form1_Click() Handles Me.Click Dim x As Array x = VB语言, VB.Net语言, C+语言, C#语言 MsgBox(x(Len(x(2) - x.Length - x.Rank) End SubA.VB语言B.VB.Net语言C.C+语言D.C#语言答案:A2、下列有关ReDim语句的叙述中,正确的是( )。A.ReDim语句只能更改一维数组的大小B.ReDim语句是一种非执行语句C.它和Dim语句一样,可以定义数组的大小,可以写在程序的任何地方D.它只能用于过程内部答案:D3、把整型
4、数组a的大小更改为6,并要求保留老数据,下面的语句正确的是( )。A.ReDim a(5)B.ReDim Preserve a(6)C.ReDim Preserve a(5)D.ReDim a(6)答案:C4、把整型数组intScore的大小更改为6,下面的语句正确的是( )。A.Array.Resize(intScore, 5)B.intScore.Resize(5)C.intScore.Resize(6)D.Array.Resize(intScore, 6)答案:D5、下面代码执行后,strTemp中的结果是( )。 Dim i, j, m, n, intArray(3, 3) As In
5、teger, strTemp As String For i = intArray.GetLowerBound(0) To intArray.GetUpperBound(0) For j = intArray.GetLowerBound(1) To intArray.GetUpperBound(1) If i = 1 Then intArray(i, j) = j + 1 Else intArray(i, j) = i * j Next Next For m = 1 To 2 For n = 1 To 3 strTemp &= intArray(m, n) Next n Next mA.234246B.123369C.123246D.246369答案:A