1. 有如下VB程序段:

Private Sub Command1_Click()

    Dim a(1 To 100) As String, x As String, st As String

    Dim i As Integer, j As Integer, n As Integer

    x = Text1.Text

    n = Len(Text1.Text)

    For i = 1 To n

        a(i) = Mid(x, i, 1)

    Next i

    For i = 1 To n - 1

        For j = n To i + 1 Step -1

             If a(j) > a(j - 1) Then

                st = a(j): a(j) = a(j - 1): a(j - 1) = st

            End If

        Next j

    Next i

    st = “ ”

    For i = 1 To n

        st = st + a(i)

    Next i

    Label1.Caption = st

End Sub

程序运行时,在文本框Text1中输入“Text”(不包含双引号),单击按钮Command1,则在标签Label1上显示的内容为(  )

A. Tetx B. Txte C. xtTe D. xteT
【考点】
排序算法及程序实现;
【答案】

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