执行下列程序段:Dim a, k As Integer、a = 6、For k = 1 To 0、a = a + k、Next k、 MsgBox(Str(k) + " " + Str(a)),输出的结果是
举一反三
- 有如下程序段 Dim a(4) As Integer,b(4) As Integer For k=0 to 2 a(k+1)=k*2 b(3-k)=a(k-1) Next k Print b(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)
- 若执行以下程序段时依次输入3,4,5,则执行结果为 ________。 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)
- 设执行以下程序段时依次输入1、3、5,执行结果为 。 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: 1 B: 3 C: 5 D: 0