试题

试题 试卷

logo

题型:单选题 题类:常考题 难易度:困难

浙江省杭州市建人高复2018-2019学年高三上学期信息技术12月月考试卷

【加试题】有如下VB程序段:

  Dim a(1 To 8) As Integer

  a(1) = 12: a(2) = 44: a(3) = 65: a(4) = 26

a(5) = 48: a(6) = 91: a(7) = 98: a(8) = 13

  n = 8: t = 0

  For i = 1 To n - 1

    k = i

    For j = i + 1 To n

      If a(j) < a(k) Then k = j

    Next j

    If k <> i Then

      temp = a(i): a(i) = a(k): a(k) = temp: t = t + 1

    End If

  Next i

  Text1.Text = Str(t)

该程序段运行后,文本框Text1中显示的内容是(  )

A、5 B、7 C、8 D、28
举一反三
返回首页

试题篮