在C盘当前文件夹下有一个已建立好的顺序文件Alph.txt,文件内容为只含有字母的一个字符串(有双引号界定符)。单击窗体,打开Alph.txt文件,读取字符串并显示在文本框Text1中,然后调用StrSort过程将此字符串按ASCII码的顺序重新排列并显示在文本框Text2,最后将重新排列的字符串存入AlpO.txt文件中(无双引号界定符)。请选择横线处合适的语句( )。 Private Sub Form_Load() Dim StrIn As String, StrOut As StringOpen "C:\Alph.txt" For Input As #1______CloseText1.Text = StrIn______Text2.Text = StrOutOpen "C:\AlpO.txt" For Output As #2______Close End Sub Private Function StrSort(s As String) As String Dim sArr() As String * 1, i As Integer, j As Integer, n As Integer Dim t As String * 1n = Len(s)ReDim sArr(n)For i= 1 To n sArr(i) = Mid(s, i, 1)Next iFor i= 1 To n-1 For j =i+1 To nIf sArr(i)>sArr(j) Then t = sArr(i): sArr(i) = sArr(j): sArr(j) = tEnd IfNext j, iFor i= 1 To n StrSort = StrSort & sArr(i)Next i End Function
A.Input #1, StrIn StrIn Print #2, StrOut
B.Input #1, StrIn StrSort(StrI Print #2, StrOut
C.Input #2, StrIn StrSort(StrI Print #1, StrOut
D.Print #1, StrIn StrSort(StrI Input #2, StrOut