[单选题]

下列程序段运行后,其运行结果是( )。

D.im a(3) As Integer, b(3) As Integer

F.or k = 0 To 3

a(k) = k*k +k

b(k) = a(k)-k

Next k

Print a(2) + b(1)

A. 5

B. 6

C. 7

D. 8

参考答案与解析:

相关试题

下列程序段的运行结果是()。Sub sele()Dim n As Integer

[单选题]下列程序段的运行结果是( )。Sub sele()D.im n As Integeri=21:n=3D.o While i>ni=i-nLoopPrint iE.nd SubA.2B.4C.5D.3

  • 查看答案
  • 下列程序段的运行结果是()。Subsele()Dim n As Integeri

    [单选题]下列程序段的运行结果是( )。 Subsele() Dim n As Integer i=21:n=3 Do While i>n i=i-n Loop Print i End SubA.2B.4C.5D.3

  • 查看答案
  • 以下程序段的执行结果是 ______。Dim a As Integer,b As

    [单选题]以下程序段的执行结果是 ______。 Dim a As Integer,b As Integer For a=4 To 1 Step-1 b=b+a Next a Print b, aA.100B.9 1C.10 1D.90

  • 查看答案
  • 下列程序段的运行结果是()。 Sub sele()Dim n As Intege

    [单选题]下列程序段的运行结果是( )。 Sub sele() Dim n As Integer i=21: n=3 Do While i > n i=i-n Loop Print i End SubA.2B.4C.5D.3

  • 查看答案
  • 下面程序段运行后,变量x的值为上()。 Dim x As Integer Dim

    [试题]下面程序段运行后,变量x的值为上 [ ] 。D.im x As IntegerD.im i As Integerx=Ofor i=0 to 50 step 10X=X+inext i

  • 查看答案
  • 以下程序段运行的结果是______。Dim a(£­1 To 5)As Bool

    [单选题]以下程序段运行的结果是______。 Dim a(-1 To 5)As Boolean Dim flag As Boolean flag=False Dim i As Integer Dim j As Integer Do Until flag=True For i=-1 To 5 j=j+l If a(i)=False Then a(i)=True Exit For End If If i=5 Then flag=True End If Next Loop Print jA.20B.7C.35

  • 查看答案
  • 以下程序段运行的结果是 ______。Dim a(£­1 To 5)As Boo

    [单选题]以下程序段运行的结果是 ______。 Dim a(-1 To 5)As Boolean Dim flag As Boolean flag=False Dim i As Integer Dim j As Integer Do Until flag=True For i=-1 To 5 j=j+1 If a(i)=False Then a(i)=True Exit For End If If i=5 Then flag=True End If Next Loop Print jA.20B.7C.3

  • 查看答案
  • 以下程序段运行的结果是______。Dim a(~1 To 5)As Boole

    [单选题]以下程序段运行的结果是______。 Dim a(~1 To 5)As Boolean Dim flag As Boolean flag=False Dim i As Integer Dim j As Integer Do Until flag=True For i=-1 To 5 j=j+1 If a(i)=False Then a(i)=True Exit For End If If i=5 Then flag=True End If Next Loop Print jA.20B.7C.35

  • 查看答案
  • 以下程序段运行的结果是______。Dim a(£­1 To 5) As Boo

    [单选题]以下程序段运行的结果是______。Dim a(-1 To 5) As BooleanDim flag As Booleanflag = FalseDim i As IntegerDim j As IntegerDo Until flag = True For i=-1 To 5 j=j+1 If a(i)= False Then a(i)= True Exit For End If If i = 5 Then flag = True End If NextLoopPrint jA.20B.7C

  • 查看答案
  • 以下程序段运行的结果是: ______。Dim a(£­1 To 5)As Bo

    [单选题]以下程序段运行的结果是: ______。 Dim a(-1 To 5)As Boolean Dim flag As Boolean flag=False Dim i As Integer Dim j As Integer Do Until flag=True For i=-1 To 5 j=j+1 If a(i)=False Then a(i)=True Exit For End If If i=5 Then flag=True End If Next Loop Print jA.20B.7C.

  • 查看答案
  • 下列程序段运行后,其运行结果是( )。Dim a(3) As Integer,