试题

试题 试卷

logo

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

浙江省宁波市十校2019届高三上学期9月联考试卷

(加试题) 有如下VB程序段:

Dim a(1 To 10) As Integer

Dim s As String, n, i As Integer

s = "54851845236": n = Len(s)

For i = 1 To n - 1

a(i) = Val(Mid(s, i, 2))

Next i

For i = 1 To n - 2

k = i

For j = i + 1 To n - 1

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

Next

If k <> i Then

t = a(k): a(k) = a(i): a(i) = t

End If

Next i

Text1.Text = Str(a(1))

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

A、18 B、54 C、85 D、8
举一反三
返回首页

试题篮