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

a(1) = 12: a(2) = 44: a(3) = 65: a(4) = 36: a(5) = 58

x = 0: y = 0

For i = 1 To 4

    k = i

    For j = i + 1 To 5

        If a(j) > a(k) Then

            k = j

            x = x + 1

        End If

    Next j

    If k <> i Then

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

        y = y + 1

    End If

Next i

Text1.Text = Str(x) + Str(y)

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

A、5 3
B、5 5
C、10 3
D、10 5
知识点
参考答案
采纳过本试题的试卷
教育网站链接