有如下程序段 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) 执行程序段的结果是
举一反三
- 设执行以下程序段时依次输入1、3、5,执行结果为_____。 Dim a(4) As Integer Dim 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)
- 有如下的程序段: Dim a(4) As Integer Dim b(4) As Integer For k=0 To 2 a(k+1)=Val(InputBox("Enter data:")) b(3-k)=a(k+1) Next k Print b(k) 程序运行后,依次输入1,3,5,输出的结果是______________。 A: 1 B: 3 C: 5 D: 0
- 设执行以下程序段时依次输入1、3、5,执行结果为______。 Dim a(4) As Integer Dim b(4) As Integer For K =0 To 2 a(K+1) =Val(InputBox("请输入数据:")) b(3-K) = a(K+1) Next K Debug. Print b(K) A: 1 B: 3 C: 5 D: 0
- 设执行以下程序段时依次输入:1、3、5,执行结果为 Dim a(4)As Integer Dim b(4)As Integer For K=0 to 2 a(K+1)=Val(InputBox("请输入数据:")) b(3-K)=a(K+1) Next K Debug.Print b(K) A: 1 B: 3 C: 5 D: 0
- 设执行以下程序段时依次输入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