Thought is the problem of data type Then replace all of type int with long The results are the same Save the children. The day after tomorrow is the course design of defense
CodePudding user response:
Very simple implementation, even the function declarations and ending six lines, But you take my code without thought about defense,
Option Explicit
Private Sub Command1_Click () The Debug. Print "DEC:"; Chuk (100, 10) The Debug. Print "HEX"; Chuk (100, 16) The Debug. Print "OCT:"; Chuk (100, 8) The Debug. Print "BIN:"; Chuk (100, 2) End Sub
Private Function chuk (ByVal C As Long, ByVal k As an Integer) Do Chuk=Hex Mod k (C) & amp; Chuk C=C \ k Loop While C & gt; 0 End the Function