试题

试题 试卷

logo

题型:单选题 题类:常考题 难易度:普通

浙江省诸暨市2019-2020学年高二上学期信息技术期末考试试卷

某算法的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
举一反三
返回首页

试题篮