下列程序段的执行结果为________。 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)
举一反三
- 下列程序段的执行结果为_______。 M=0 For I=1 To 3 For J =5 To 1 Step-1 N = N+1 Next J,I Print N;J;I
- 下列程序段不能正确显示1!、2!、3!、4!的结果的是 。 A: For i = 1 To 4 For j = 1 To i n = 1 n = n * j Next j MsgBox( n)Next i B: Dim i%, j%, n%For i = 1 To 4 n = 1 For j = 1 To i n = n * j Next j MsgBox( n)Next i C: Dim j%, n%n = 1For j = 1 To 4 n = n * j MsgBox( n)Next j D: Dim j%, n%n = 1j = 1Do While j<=4 n=n*j MsgBox(n) j=j+1Loop E: Dim j%, n%n = 1j = 1Do n=n*j MsgBox(n) j=j+1Loop While j<=4
- 下面____程序段不能正确显示1!、2!、3!、4!的值。 A: For I=1 To 4 n=1 For j=1 to I n=n*j Next j Print n Next I B: For I=1 To 4 For j=1 to I n=1 n=n*j Next j Print n Next I C: n=1 For j=1 to 4 n=n*j Print n Next j D: n=1:j=1 Do While j<=4 n=n*j Print n j=j+1Loop
- 有如下程序段: 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
- 下列程序输出结果是:() int i,j,m,n; m=n=0; for(i=0;i<2;i++) for(j=0;j<2;j++) if(j>=i)m=1;n++; printf("n=%d ",n);