1、填空题 11. 执行下面程序,单击命令按钮 Command1,则窗体上显示的第一行是 (1) ,最后一行是(2) 。Option ExplicitOption Base 1Private Sub Command1_Click()Dim n As Long, k As Integer, a() As Integern = 123456789Dok = k + 1ReDim Preserve a(k)a(k) = n Mod 100n = n 100Loop Until n = 0For k = 1 To UBound(a)Print fun(a(k)Next kEnd SubPrivate Fu
2、nction fun(n As Integer) As IntegerDim k As Integerk = n Mod 10fun = k * 10 + (n 10)End Function2. 执行下面程序,单击命令按钮 Command1,则数组元素 a(2, 1)的值是 (3) ,a(1, 2)的值是(4) 。Option ExplicitOption Base 1Private Sub Command1_Click()Dim a(3, 3) As Integer, i As Integer, k As IntegerDim n As Integern = 9For k = 1 To 3
3、For i = 1 To 3a(i, k) = nn = n - 1Next iNext kFor i = 1 To 3For k = 1 To 3Print a(i, k);Next kPrintNext iEnd Sub3. 执行下面程序,单击命令按钮 Command1,则窗体上显示的第一行是 (5) ,第二行是(6) ,第三行是 (7) 。Option ExplicitPrivate Sub Command1_Click()Dim i As Integer, a As Integer, b As Integera = 1b = 2i = aDo While fun(i, b) 0 Thenr = n Mod kTran = Tran(n k, k) jPrint Conver(data)End SubPrivate Function Conver(a() As String) As StringDim i As IntegerFor i = 1 To UBound(a)Conver = Conver Next jPrintNext iEnd Sub