举一反三
- 在窗体上面添加一个命令按钮Command1,然后编写如下事件过程: Private Sub Command1_Click() Dim a1(4, 4), a2(4, 4) For i = 1 To 4 For j = 1 To 4 a1(i, j) = i + j a2(i, j) = a1(i, j) + i + j Next j Next i Print a1(3, 3); a2(3, 3) End Sub 程序运行后,单击命令按钮,在窗体上输出的内容是( )
- 在窗体上画一个名为Command1的命令按钮,然后编写如下代码: Option Base 1 Private Sub Command1_ Click() Dim arr(4, 4) For i = 1 To 4 For j = 1 To 4 arr(i, j) = (i - 1) * 3 + j Next j Next i For i = 1 To 2 For j = 1 To 2 Print arr(i, j) Next j Next i End Sub程序运行后,单击命令按钮,输出结果为______ 。 A: 3 4 6 7 B: 7 8 10 11 C: 1 2 4 5 D: 8 9 12 13
- 在窗体上画一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1_Click() Dim a1(4,4),a2(4,4) Fori=1 To 4 For j=1 To 4 a1(i,j)=i+j a(i,j)=al(i,j)+i+j Next j Next i Print a1(3,3);a2(3,3) End Sub 程序运行后,单击命令按钮,在窗体上输出的是______。 A: A) 6 6 B: B) 10 5 C: C) 7 21 D: D) 6 12
- 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() a=0 For i=1 To 2 For j=1 To 4 If j Mod 2<>0 Then a=a-1 End If a=a+1 Next j Next i Print a End Sub 程序运行后,单击命令按钮,输出结果是 A: 0 B: 2 C: 3 D: 4
- 在窗体上添加一个命令按钮Command1,然后编写如下事件过程: Private Sub Command1_Click() For i = 1 To 4 x = 4 For j = 1 To 3 x = 3 For k = 1 To 2 x = x + 6 Next k Next j Next i Print x End Sub 程序运行后,单击命令按钮,显示结果为( )。
内容
- 0
在窗体上画一个命令按钮(其Name属性为Command1),然后编写如下代码: Option Base 1 Private Sub Command1_Click() Dim a(4,4) For i=1 To 4 For j=1 To 4 a(i,j)=(i-1)*3+j Next j Next i For i=3 To 4 For j=3 To 4 Print a(j,i); Next j Next i End Sub 程序运行后,单击命令按钮,其输出结果为 ______ 。 A.6 9 7 10 B.7 10 8 11 C.8 11 9 12 D.9 12 10 13
- 1
在窗体上画一个名为Command1的命令按钮,然后编写如下代码: Option Base 1 Private Sub Command1_Click() Dim a a=Array(1, 2, 3, 4) j=1 For i=4 To 1 Step_1 s=s+a(i)*j j=j*10 Next i Print s End Sub 运行上面的程序,其输出结果是______。 A: 1234 B: 12 C: 34 D: 4321
- 2
运行以下程序,单击命令按钮后在窗体上输出内容_________。Private Sub Command1_Click()Dim a() As IntegerDim i As Integer, j As IntegerReDim a(3, 4)For i = 1 To 3For j = 1 To 4a(i, j) = i* 10 + jNext jNext iReDim a(4, 5)Print a(2, 3)End Sub
- 3
在窗体上面一个名称为Command1的命令按钮,并编写如下程序: Option Base 1 Private Sub Command1_Click() Dim a(4,4) For i=1 To 4 For j=1 To 4 a(i,j)=(i-1)*3+j Next j Next j For i=3 To 4 For j=3 To 4 Print a(j,i); Next j Print Ncxt i End Sub 运行程序,单击命令按钮,则输出结果为______。 A: 6 97 10 B: 7 108 11 C: 8 119 12 D: 9 1210 13
- 4
窗体上有一个命令按钮Command1,编写如下事件过程: Private Sub Command1_Click() For i=1 to 4 For j=4 to 8 sum=sum+1 Next j Next i Print sum End Sub 运行时,单击按钮,输出结果是( )