Dim strr 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 Input #1, strr For i = 1 To Len(strr) If Val(Mid(strr, i, 1)) <> 0 Then List1.AddItem Val(Mid(strr, i, 1)) + 100000 If Val(Mid(strr, i, 1)) = 0 Then List1.AddItem Asc(Mid(strr, i, 1)) + 100000 Next For ii = 0 To Len(strr) - 1 If (List1.List(ii) - 100000) > 9 Then Print #2, Chr(List1.List(ii) - 100000) & ""; If (List1.List(ii) - 100000) < 10 Then Print #2, List1.List(ii) - 100000 & ""; Next Close #2 Close #1 End End Sub
Dim n As Integer 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, w n = Len(w) For i = 1 To n x = Mid(w, i, 1) x = Asc(x) + 200 List1.AddItem x Next For i = 0 To n - 1 x = List1.List(i) e = e & Chr(x - 200) Next Print #2, e 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 Input #1, x For i = 1 To Len(x) t = Asc(Mid(x, i, 1)) m = t + 100 List1.AddItem m Next For i = 0 To Len(x) - 1 z = z & Chr(List1.List(i) - 100) Next Print #2, z 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 Input #1, x For i = 1 To Len(x) t = Asc(Mid(x, i, 1)) Select Case t Case 48 To 57 List1.AddItem Chr(t) Case 65 To 90 List2.AddItem Chr(t) Case 97 To 122 List3.AddItem Chr(t) End Select Next For k = 0 To List1.ListCount - 1 Print #2, List1.List(k); Next For k = 0 To List2.ListCount - 1 Print #2, List2.List(k); Next For k = 0 To List3.ListCount - 1 Print #2, List3.List(k); Next Close Close End End Sub
Dim strr 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
Input #1, strr
For i = 1 To Len(strr)
If Val(Mid(strr, i, 1)) <> 0 Then List1.AddItem Val(Mid(strr, i, 1)) + 100000
If Val(Mid(strr, i, 1)) = 0 Then List1.AddItem Asc(Mid(strr, i, 1)) + 100000
Next
For ii = 0 To Len(strr) - 1
If (List1.List(ii) - 100000) > 9 Then Print #2, Chr(List1.List(ii) - 100000) & "";
If (List1.List(ii) - 100000) < 10 Then Print #2, List1.List(ii) - 100000 & "";
Next
Close #2
Close #1
End
End Sub
以上程式正確:D
回覆刪除Dim n As Integer
回覆刪除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, w
n = Len(w)
For i = 1 To n
x = Mid(w, i, 1)
x = Asc(x) + 200
List1.AddItem x
Next
For i = 0 To n - 1
x = List1.List(i)
e = e & Chr(x - 200)
Next
Print #2, e
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
Input #1, x
For i = 1 To Len(x)
t = Asc(Mid(x, i, 1))
m = t + 100
List1.AddItem m
Next
For i = 0 To Len(x) - 1
z = z & Chr(List1.List(i) - 100)
Next
Print #2, z
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
Input #1, x
For i = 1 To Len(x)
t = Asc(Mid(x, i, 1))
Select Case t
Case 48 To 57
List1.AddItem Chr(t)
Case 65 To 90
List2.AddItem Chr(t)
Case 97 To 122
List3.AddItem Chr(t)
End Select
Next
For k = 0 To List1.ListCount - 1
Print #2, List1.List(k);
Next
For k = 0 To List2.ListCount - 1
Print #2, List2.List(k);
Next
For k = 0 To List3.ListCount - 1
Print #2, List3.List(k);
Next
Close
Close
End
End Sub