下面程序执行时,输出的结果是( )。 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
A: A) 50 10
B: B) 50 9
C: C) 57 10
D: D) 59 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