有如下程序: total = 0 For k = 1 To 3 If k> =1 Then part = 1 Elself k > = 2 Then part = 2 Elself k > =3 Then part = 3 Else part = 4 End If Print part; total = total + part Next k Print total 运行时输出的结果是 【14】 。
举一反三
- part 1 1-3 part 2 part 3 part 4
- 下列程序段的执行结果为( )。 a=5 For k=1 To 0 a=a * k Next k Print k;a A: 2 2 B: 4 3 C: 4 2 D: 3 2
- 运行下列程序,单击窗体后显示结果为( )。 Private Sub Form_Click() Dim k As Integer For k = 1 To 2 Print "3" + k; "3" & k; Spc(3); Next End Sub
- Part 1 Main idea: __________________________________________________________________________________________. Part 2 Main idea: __________________________________________________________________________________________. Part 3 Main idea: __________________________________________________________________________________________.
- 下列程序输出结果是______。 k=0 while k<=3: k=k+2 print(k) A: 0 B: 2 C: 3 D: 4