当前位置: 高中信息技术 / 单选题
  • 1. (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

微信扫码预览、分享更方便