下列程序段的执行结果为( )。 a=6 For k=1 To 0 a=a+k Next k Print k;a
A: -1 6
B: 1 16
C: 1 6
D: 11 21
A: -1 6
B: 1 16
C: 1 6
D: 11 21
举一反三
- 执行下列程序段:Dim a, k As Integer、a = 6、For k = 1 To 0、a = a + k、Next k、 MsgBox(Str(k) + " " + Str(a)),输出的结果是
- 下列程序段的执行结果为【 】。 K=0 For J=1 To2 For I = 1 To 3 K=I+1 Next I For I=1 To7 K=K+I Next I Next J Print K
- 设执行以下程序段时依次输入2,4,6执行结果为 Dim a(4) As Integer,b(4) As Integer For k =0 To 2 a(k + 1) = Val(InputBox( "Enter data:" ) ) b(3 - k) =a(k + 1) Next Print b(k) A: 2 B: 4 C: 6 D: 0
- 设执行以下程序段时依次输入11、33、55,执行结果为 Dim a(4) As Integer, b(4) As Integer For K = 0 To 2 a(K + 1) = Val(InputBox("请输入数据")) b(3 - K) = a(K + 1) Next K Print b(K)
- 下列程序段的执行结果为( )。 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