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

Dim a(1 To 10) As Integer

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

t = 0

For i = 1 To n - 1

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

Next i

For i = 1 To n - 2 Step 2

    k = i

    For j = i + 2 To n - 1 Step 2

        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、1
B、2
C、3
D、4
知识点
参考答案
采纳过本试题的试卷
教育网站链接