执行如下VB代码后,变量i和m的值分别是( ): m% = 0 For i = 1 To 3 For j = 1 To i m = m + j Next j Next i
A: 3 6
B: 3 10
C: 4 6
D: 4 10
A: 3 6
B: 3 10
C: 4 6
D: 4 10
举一反三
- 执行下列程序段后,i和m的值为( )。m = 0For i = 1 To 3 For j = 1 To i m = m + jNext j, i A: 3 6 B: 3 10 C: 4 6 D: 4 10
- 执行下列程序段后,i和m的值为()。 m = 0 For i = 1 To 3 For j = 1 To i m = m + j Next j, i
- 下列程序段的执行结果为________。 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)
- 请阅读程序: Private Sub Form_Click() m=1 For i=4 To 1 Step-1 Print str(m); m=m+1 For j=1 To i Print "*"; Next j Print Next i End Sub 程序运行后,单击窗体,则输出结果是______。 A: 1**** 2*** 3** 4* B: 4**** 3*** 2* 1* C: **** *** **** * D: * ** *** ****
- 窗体上命令按钮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