下列程序循环次数为______。 s = 0 For i = 1 To 20 Step 2 s = s + i 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 = s +1执行了几次? For i = 0 To 7 Step 3 For j = 0 To 7 Step 2 s = s + 1 Next Next
- 运行下列程序,单击窗体显示的结果为( )。 Private Sub Form_Click() Dim a Dim s As Integer, i As Integer a = Array(1, 2, 3) For i = 2 To 0 Step -1 s = s + a(i) * a(i) Next i Print s End Sub