已知程序段:
s=0
For i=1 to 10 step 2
s=s+1
i=i*2
Next i
该程序段的循环次数是( )。
s=0
For i=1 to 10 step 2
s=s+1
i=i*2
Next i
该程序段的循环次数是( )。
举一反三
- 存在程序段: s=0 For i=1 to 10 step 2 s= s + 1 i= i * 2 Next i 当循环结束后,变量i ,s 的值分别为().
- 执行下列程序段,则当循环结束后,变量i的值为______,变量s的值为______。 S=0 For i=1 To 10 Step 2 s=s+1 i=i*2 Next i
- 下列程序循环次数为______。 s = 0 For i = 1 To 20 Step 2 s = s + i Next i
- 下列程序段中,循环体s = s +1执行了几次? For i = 0 To 7 Step 3 For j = 0 To 7 Step 2 s = s + 1 Next Next
- 有如下程序段:s = 0For i = 1 To 10 s = s + iNext iPrint s与上述程序段输出结果相同的程序段为( )。 A: s = 0: i = 0 While i <= 10 i = i + 1 s = s + i Wend Print s B: s = 0: i = 1 While i < 10 i = i + 1 s = s + i Wend Print s C: s = 0: i = 1 Do s = s + i i = i + 1 Loop While i < 10 Print s D: s = 0: i = 1 Do s = s + i i = i + 1 Loop Until i > 10 Print s