Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Do While Not EOF(1) Input #1, m Input #1, n If n > 0 And m > 0 Then Print #2, Anyturn((m), n) Loop Close Close End End Sub
Function Anyturn(b, ByVal a) Dim ans, s s = Split("0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z") Do x = a Mod b ans = s(x) & ans a = a \ b Loop Until a = 0 Anyturn = ans End Function
Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Do While Not EOF(1) Input #1, A, B Print #2, ten_to_any(A, B) Loop Close #2 Close #1 End End Sub
Function ten_to_any(A, B) Dim ans As String, C() As String ans = "" C = Split("0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z") Do x = B Mod A ans = C(x) & ans B = B \ A Loop Until B = 0 ten_to_any = ans End Function
Private Sub Form_Load()
回覆刪除Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Do While Not EOF(1)
Input #1, m
Input #1, n
If n > 0 And m > 0 Then Print #2, Anyturn((m), n)
Loop
Close
Close
End
End Sub
Function Anyturn(b, ByVal a)
Dim ans, s
s = Split("0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z")
Do
x = a Mod b
ans = s(x) & ans
a = a \ b
Loop Until a = 0
Anyturn = ans
End Function
規則都一樣,
回覆刪除只是符號的增加:D
Private Sub Form_Load()
Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Do While Not EOF(1)
Input #1, A, B
Print #2, ten_to_any(A, B)
Loop
Close #2
Close #1
End
End Sub
Function ten_to_any(A, B)
Dim ans As String, C() As String
ans = ""
C = Split("0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z")
Do
x = B Mod A
ans = C(x) & ans
B = B \ A
Loop Until B = 0
ten_to_any = ans
End Function
arro、佑好,
回覆刪除程式正確。
而且,這邊練習一下之後,以後計概那邊也會了吧。