在窗体的通用声明处有语句Dim a() As Single,以下重新定义数组的语句中,正确的是()。
A: ReDim a(3,3):ReDim a(3,4) As Double
B: ReDim a(3,3):ReDim Preserve a(4,4)
C: ReDim a(3): ReDim a(3,3) As Double
D: ReDim a(3,3):ReDim Preserve a(3,4)
A: ReDim a(3,3):ReDim a(3,4) As Double
B: ReDim a(3,3):ReDim Preserve a(4,4)
C: ReDim a(3): ReDim a(3,3) As Double
D: ReDim a(3,3):ReDim Preserve a(3,4)
举一反三
- 下列声明中正确的是______。 A: Dim a() As BooleanReDim a(8,5) B: Dim a()ReDim a(5) As Integer C: Dim a(3) As IntegerReDim a(5) D: Dim a()ReDim 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
- 对于数组d(n),要增加2个数组元素,又要保留原来数组中的数据,以下语句中正确的写法是________。 A: ReDim Preserve d(n+2) B: Dim d(n+2) C: Dim Preserve d(n+2) D: ReDim d(n+2) E: ReDim d(n2)
- 对于正在使用的数组x(n),要增加2个数组元素,又要保留原来数组中的值,以下语句中正确的写法是_________。 A: ReDim Preserve x(n+2) B: Dim x(n+2) C: ReDim x(n+2) D: Dim Preserve x(n+2) E: Dim x(n+2) As ReDim
- 运行以下程序,单击命令按钮后,如果用户从键盘上输入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