有一段程序: a = Array(1, 2, 3, 4, 5, 6): s =1: For i = 5 To 1 Step -2: s = s * a(i): Next I, 执行后,s的结果是
举一反三
- 存在程序段: s=0 For i=1 to 10 step 2 s= s + 1 i= i * 2 Next i 当循环结束后,变量i ,s 的值分别为().
- 执行下列程序段后,程序的运行结果为()。 s = 1 For i = 1 To 3 For j = 0 To i - 1 s = s + s * j Next j Print s; Next i
- 运行下列程序,单击窗体显示的结果为( )。 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
- 下列程序中 s = s + j 语句共执行了______次。 Dim s As Integer Dim i As Integer, j As Integer For i = 1 To 10 Step 2 For j = 1 To 5 Step 2 s = s + j Next j Next i Print s
- 下列程序段中,循环体s = s +1执行了几次? For i = 0 To 7 Step 3 For j = 0 To 7 Step 2 s = s + 1 Next Next