组卷题库 > 高中信息技术试卷库
试题详情
有如下VB程序段:

Private Sub Command1_Click()

Dim a( 1 To 6) As Integer, i As Integer

For i= 1 To 6 

  a(i) =Int(Rnd*5) *2+ 1

Next i

For i=2 To 6 Step 2

    a(i) =cha(a(i-1) , a(i) )

  Next i

End Sub

Function cha(x As Integer, y As Integer) As Integer

  Dim t As Integer

  If x<y Then

    t=x:x=y:y=t

    cha=y

  Else

  cha=x-1

  End If

EndFunction

执行该程序段后,在下列选项中,a(1)~a(6)各元素值可能的是(  )

A、8,9,3,2,5,1
B、7,6,5,5,3,1
C、9,3,5,4,4,3
D、7,3,1,0,5,4
知识点
参考答案
采纳过本试题的试卷
教育网站链接