A: 50 10
B: 50 9
C: 57 10
D: 57 9
举一反三
- 下面程序执行时,输出的结果是( )。 Private Sub Form_Click() Dim i As Integer,j As Integer i=10 Do i=i+j for j=10 to step-3 i=i+j next i Loop While i<50 Print i; j End Sub A: A) 50 10 B: B) 50 9 C: C) 57 10 D: D) 59 9
- 下面程序运行后,语句“Print i”执行的次数是( )。 Private Sub Form_Click() Dim i As Integer,j As Integer i=0 Do i=i+1 Forj=10 To 1 Step-3 i=i+j Print i Next j Loop While i<50 End Sub A: 4 B: 8 C: 12 D: 16
- 下列程序段的执行结果为 _______。 Dim a(3, 5) As Integer Dim i As Integer, j As Integer For i = 1 To 3 For j = 1 To 5 a(i, j) = a(i - 1, j - 1) + (i - 1) * 5 + j Next j Next i Print a(3, 4)
- 下列程序中 s = s + j 语句共执行了______次。 Dim s As Integer Dim i As Integer, j As Integer For i = 1 To 10 Step 2 For j = 1 To 5 Step 2 s = s + j Next j Next i Print s
- 窗体上命令按钮Command1的事件过程如下: Option Base 1 Private Sub Command1_Click() Dim a(4,4)As Variant 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(i,j) Next j Next i End Sub 该程序执行后,输出结果是( )。 A: 9 B: 10 C: 12 D: 13 E: 7 F: 10 G: 12 H: 13 I: 9 J: 12 K: 10 L: 13 M: 8 N: 11 O: 9 P: 12
内容
- 0
下列程序: Option Base 1 Private Sub Form_Click() Dim a(5,5) For i = 1 To 5 For j = 1 To 5 k = k + 1 a (i,j)= k Next j Next i For i = 1 To 5 s = s + a (i,i) Next i Print s End Sub 运行时的输出结果是( )。
- 1
运行以下程序,单击命令按钮后在窗体上输出内容_________。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
- 2
在窗体上画一个命令按钮(其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
- 3
下列程序段的执行结果为________。 Dim M(10), N(10) i= 4 For j = 1 To 7 M(j) = j N(i) = 2 * i + j Next j Print N(i); M(i)
- 4
在窗体上画一个名称为Command1的命令按钮 ,并编写如下程序:Option Base 1Private 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 Print Next iEnd Sub运行程序,单击命令按钮,则输出结果为______。 A: 6 9 7 10 B: 7 10 8 11 C: 8 11 9 12 D: 9 12 10 13