1. 有程序段如下:

Dim a(1 To 8) As Integer

K = 8: n = 8

For i = 1 To 3

    For j = i + 1 To n

        If a(i) < a(j) Then

            t = a(i): a(i) = a(j): a(j) = t

        End If

    Next j

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

        If a(k) > a(j) Then

            t = a(k): a(k) = a(j): a(j) = t

        End If

    Next j

    k = k - 1

Next i

数组元素a(1)~a(8)中的初始值为:8,13,7,14,6,9,5,12,执行该程序段后,数组元素a(1)~a(8)中的值将变为(     )

A. 14,13,12,8,9,7,6,5 B. 5,6,7,9,8,12,13,14 C. 5,6,7,8,9,12,13,14 D. 14,13,12,9,8,7,6,5
【考点】
排序算法及程序实现;
【答案】

您现在未登录,无法查看试题答案与解析。 登录
单选题 困难
能力提升
变式训练
拓展培优
真题演练
换一批