Home > Software engineering >  VB sprout new deliver
VB sprout new deliver

Time:11-19

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

CodePudding user response:

reference 1/f, crispy big ice cream reply:
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

Thank you very much, I'll check information and thinking seriously

CodePudding user response:

A=a + r * k ^ I
As far as I know, behind index operator ^ don't support variable, so let's manual cycle multiplication;

CodePudding user response:

The
reference 3 floor milaoshu1020 response:
a=a + r * k ^ I
As far as I know, behind index operator ^ don't support variable, so let's manual cycle multiplication;


 
Dim As a Integer
Dim As Integer b

A=3
B=2
The Debug. Print a ^ b


No problem,

CodePudding user response:

references 4 floor crispy ice cream response:
Quote: refer to the third floor milaoshu1020 response:

A=a + r * k ^ I
As far as I know, behind index operator ^ don't support variable, so let's manual cycle multiplication;


 
Dim As a Integer
Dim As Integer b

A=3
B=2
The Debug. Print a ^ b


No problem

Write wrong, sorry...
  • Related