Dim num As Integer Dim ans(10) As String Private Sub Form_Load()
Open App.Path & "\in.txt" For Input As #1 Input #1, num Close #1
countt = 0
Do
ans(countt) = Str(num Mod 16) num = num \ 16 countt = countt + 1
Loop Until num = 0
Open App.Path & "\out.txt" For Output As #2 For i = 10 To 0 Step -1 If ans(i) = Str(10) Then ans(i) = "A" If ans(i) = Str(11) Then ans(i) = "B" If ans(i) = Str(12) Then ans(i) = "C" If ans(i) = Str(13) Then ans(i) = "D" If ans(i) = Str(14) Then ans(i) = "E" If ans(i) = Str(15) Then ans(i) = "F" If ans(i) <> "" And ans(i) <> "0" Then Print #2, ans(i); Next Close #2 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 a = Split("0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F", ",") Input #1, x Do y = x Mod 16 x = x \ 16 z = a(y) & z Loop Until x = 0 Print #2, z 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 Do a = x Mod 16 x = x \ 16 Select Case a Case 10 a = "A" Case 11 a = "B" Case 12 a = "C" Case 13 a = "D" Case 14 a = "E" Case 15 a = "F" End Select b = a & b Loop Until x = 0 Print #2, b Close Close End End Sub
Dim num As Integer Dim RP, okRP, ans 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, num RP = "0 1 2 3 4 5 6 7 8 9 A B C D E F" okRP = Split(RP, " ") Do x = num Mod 16 num = num \ 16 ans = okRP(x) & ans Loop Until num = 0 Print #2, ans 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, n Do k = n Mod 16 Select Case k Case Is = 10 k = "A" Case 11 k = "B" Case 12 k = "C" Case 13 k = "D" Case 14 k = "E" Case 15 k = "F" End Select a = k & a n = n \ 16 Loop Until n = 0 Print #2, a Close Close End End Sub
Dim num As Integer
回覆刪除Dim ans(10) As String
Private Sub Form_Load()
Open App.Path & "\in.txt" For Input As #1
Input #1, num
Close #1
countt = 0
Do
ans(countt) = Str(num Mod 16)
num = num \ 16
countt = countt + 1
Loop Until num = 0
Open App.Path & "\out.txt" For Output As #2
For i = 10 To 0 Step -1
If ans(i) = Str(10) Then ans(i) = "A"
If ans(i) = Str(11) Then ans(i) = "B"
If ans(i) = Str(12) Then ans(i) = "C"
If ans(i) = Str(13) Then ans(i) = "D"
If ans(i) = Str(14) Then ans(i) = "E"
If ans(i) = Str(15) Then ans(i) = "F"
If ans(i) <> "" And ans(i) <> "0" Then Print #2, ans(i);
Next
Close #2
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
a = Split("0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F", ",")
Input #1, x
Do
y = x Mod 16
x = x \ 16
z = a(y) & z
Loop Until x = 0
Print #2, z
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
Do
a = x Mod 16
x = x \ 16
Select Case a
Case 10
a = "A"
Case 11
a = "B"
Case 12
a = "C"
Case 13
a = "D"
Case 14
a = "E"
Case 15
a = "F"
End Select
b = a & b
Loop Until x = 0
Print #2, b
Close
Close
End
End Sub
Dim num As Integer
回覆刪除Dim RP, okRP, ans 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, num
RP = "0 1 2 3 4 5 6 7 8 9 A B C D E F"
okRP = Split(RP, " ")
Do
x = num Mod 16
num = num \ 16
ans = okRP(x) & ans
Loop Until num = 0
Print #2, ans
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, n
Do
k = n Mod 16
Select Case k
Case Is = 10
k = "A"
Case 11
k = "B"
Case 12
k = "C"
Case 13
k = "D"
Case 14
k = "E"
Case 15
k = "F"
End Select
a = k & a
n = n \ 16
Loop Until n = 0
Print #2, a
Close
Close
End
End Sub