下列程序运行后,变量i中保存的值是( )。
A: = 0
B: r i=1 To 100 Step 1
C: =s + i
D: i>=50 Then Exit For
E: xt i
F: 100
G: 101
H: 50
I: 51
A: = 0
B: r i=1 To 100 Step 1
C: =s + i
D: i>=50 Then Exit For
E: xt i
F: 100
G: 101
H: 50
I: 51
举一反三
- 下列程序运行后,变量i中保存的值是() A: 100 B: 101 C: 50 D: 51
- 下列程序段运行后,变量s的值是________ A: 2:b=1:s=0 B: r I=1 To 2 Step1 C: s+a D: a+b E: b F: c G: xt I H: 3 I: 0 J: 2 K: 4
- 以下程序没有构成死循环的是( )。 A: int i=100;while(1){i=1%100+1;if(i>100);break;} B: for(;;) C: int i=100;do{i=i+1;}while(i>=1000); D: int i=100;while(i);s=s+1;
- 存在程序段: s=0 For i=1 to 10 step 2 s= s + 1 i= i * 2 Next i 当循环结束后,变量i ,s 的值分别为().
- 在下列程序段中,不能计算1到100之间奇数之和的是__________。 A: Dim sum As Integer sum = 0 For i = 1 To 100 Step 2 sum = sum + i Next B: Dim sum As Integer sum = 0 For i = 1 To 100 If i Mod 2 <> 0 Then sum = sum + i Next C: Dim sum As Integer sum = 0 For i = 1 To 99 sum = sum + i Next D: Dim sum As Integer sum = 0 For i = 100 To 1 Step -1 If i Mod 2 <> 0 Then sum = sum + i Next