有如下程序段: Dim i%, j%, n%, m%, k% m = 0 : k = 0 For i = 1 To 5 k = k + 1 n = 0 For j = 1 To 2 n = n + 1 m = m + 1 Next j Next i MsgBox(k & " " & n & " " & m)运行该程序代码段后,消息对话框中显示的内容为( )。
A: 5 10 2
B: 5 10 10
C: 5 2 10
D: 5 2 2
A: 5 10 2
B: 5 10 10
C: 5 2 10
D: 5 2 2
举一反三
- 中国大学MOOC: 有如下程序段: Dim i%, j%, n%, m%, k% m = 0 : k = 0 For i = 1 To 5 k = k + 1 n = 0 For j = 1 To 2 n = n + 1 m = m + 1 Next j Next i MsgBox(k & & n & & m)运行该程序代码段后,消息对话框中显示的内容为( )。
- 下列程序段的执行结果为________。 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)
- 下列程序段的执行结果为_____。 Dim M(10),N(10) I=3 for T=1 To 5 M(T)=T N(I)=2*I+T Next T print N(I);M(I)
- 下面程序是求100~200的全部素数,请填空 main() { int n, i, k, m = 0; for (n = 101; n <= 200; n = n + 2) { k = sqrt(n); for (i = 2; i <= k; i++) if (n%i == 0) ; if ( ) { printf("%d ", n); m = m + 1; } if (m % 10 == 0) printf("\n"); } printf("\n"); }
- 以下程序段的输出结果是 ( ) int k , n , m ; n=10 ; m=1 ; k=1 ; while ( k<=n ) {m*=2 ; k+=4 ; } printf ( "%d\n" , m );