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

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