执行以下语句,则a(2)的值是________。Dim a() As Integer = {2, 9, 8, 1, 6}ReDim a(2)
举一反三
- 下列数组声明语句中,不正确的是_________。 A: Dim a(9) As Single = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} B: Dim a() = {1, 2, 3, 4, 5, 6, 10} C: Dim a( ,) As Single = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}} D: Dim a() As Single = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} E: Dim n As Integer=10Dim a(n) As Single
- 下列数组声明语句中正确的是( )。 A: Dim A(9) As Single = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } B: Dim A( ) As Single = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } C: Dim A( ) As Single = { 1, "abc", "ccc", 4, 5, 6, 7, 8, 9, 10 } D: Dim A( , ) As Single = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
- 已知:Option Base 0,Dim a() As Integer, Dim b(-1 to 2) As Integer,如果执行 a = b ,则数组a的下界是
- 下列数组声明正确的是( )。 A: n=5 Dim a(1 to n) As Integer B: Dim a(10) As Integer ReDim a(1 To 12) C: Dim a() As Single ReDim a(3,4) As Integer ReDim a(1 to n)As Integer D: Dim a() As Integer n=5
- 运行以下程序,单击命令按钮后,如果用户从键盘上输入1、2、3、4、5、6,则窗体上输出内容为_________。 Private Sub Command1_Click() Dim a() As Integer Dim i As Integer, j As Integer ReDim a(6) For i = 5 To 10 a(10- i + 1) = InputBox("input number") Next i ReDim Preserve a(10) a(10) = a(3) + a(5) Print a(10) End Sub