Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Line Input #1, x
For i = 1 To Len(x) If Mid(x, i, 1) >= 0 And Mid(x, i, 1) <= 9 Then List1.AddItem Mid(x, i, 1) If Mid(x, i, 1) >= "a" And Mid(x, i, 1) <= "z" Then List2.AddItem Mid(x, i, 1) If Mid(x, i, 1) >= "A" And Mid(x, i, 1) <= "Z" Then List3.AddItem Mid(x, i, 1) Next For i = 0 To List1.ListCount ans = ans & List1.List(i) Next For i = 0 To List3.ListCount ans = ans & List3.List(i) Next For i = 0 To List2.ListCount ans = ans & List2.List(i) Next Print #2, ans Close Close End End Sub
Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Line Input #1, n For i = 1 To Len(n) If Mid(n, i, 1) >= 0 And Mid(n, i, 1) <= 9 Then List1(0).AddItem Mid(n, i, 1) If Mid(n, i, 1) >= "A" And Mid(n, i, 1) <= "Z" Then List1(1).AddItem Mid(n, i, 1) If Mid(n, i, 1) >= "a" And Mid(n, i, 1) <= "z" Then List1(2).AddItem Mid(n, i, 1) Next ans = "" For i = 0 To List1(0).ListCount ans = ans & List1(0).List(i) Next For i = 0 To List1(1).ListCount ans = ans & List1(1).List(i) Next For i = 0 To List1(2).ListCount ans = ans & List1(2).List(i) Next Print #2, ans Close #2 Close #1 End End Sub
Dim a() As String Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Line Input #1, x ReDim a(Len(x)) For i = 1 To Len(x) a(i) = Mid(x, i, 1) Next i For i = 1 To Len(x) For j = i To Len(x) If a(i) > a(j) Then z = a(j) a(j) = a(i) a(i) = z End If Next j Next i For i = 1 To Len(x) stra = stra & a(i) Next i Print #2, stra Close #2 Close #1 End End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Line Input #1, x
For i = 1 To Len(x)
If Mid(x, i, 1) >= 0 And Mid(x, i, 1) <= 9 Then List1.AddItem Mid(x, i, 1)
If Mid(x, i, 1) >= "a" And Mid(x, i, 1) <= "z" Then List2.AddItem Mid(x, i, 1)
If Mid(x, i, 1) >= "A" And Mid(x, i, 1) <= "Z" Then List3.AddItem Mid(x, i, 1)
Next
For i = 0 To List1.ListCount
ans = ans & List1.List(i)
Next
For i = 0 To List3.ListCount
ans = ans & List3.List(i)
Next
For i = 0 To List2.ListCount
ans = ans & List2.List(i)
Next
Print #2, ans
Close
Close
End
End Sub
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Line Input #1, n
For i = 1 To Len(n)
If Mid(n, i, 1) >= 0 And Mid(n, i, 1) <= 9 Then List1(0).AddItem Mid(n, i, 1)
If Mid(n, i, 1) >= "A" And Mid(n, i, 1) <= "Z" Then List1(1).AddItem Mid(n, i, 1)
If Mid(n, i, 1) >= "a" And Mid(n, i, 1) <= "z" Then List1(2).AddItem Mid(n, i, 1)
Next
ans = ""
For i = 0 To List1(0).ListCount
ans = ans & List1(0).List(i)
Next
For i = 0 To List1(1).ListCount
ans = ans & List1(1).List(i)
Next
For i = 0 To List1(2).ListCount
ans = ans & List1(2).List(i)
Next
Print #2, ans
Close #2
Close #1
End
End Sub
Dim a() As String
回覆刪除Private Sub Form_Load()
Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Line Input #1, x
ReDim a(Len(x))
For i = 1 To Len(x)
a(i) = Mid(x, i, 1)
Next i
For i = 1 To Len(x)
For j = i To Len(x)
If a(i) > a(j) Then
z = a(j)
a(j) = a(i)
a(i) = z
End If
Next j
Next i
For i = 1 To Len(x)
stra = stra & a(i)
Next i
Print #2, stra
Close #2
Close #1
End
End Sub