Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim s As String
Dim yushu As Byte
a = 1230
b = 16
While a <> 0
yushu = a Mod b
a = a \ b
If yushu < 10 Then
s = yushu & s
Else
s = Chr(yushu + 55) & s
End If
Wend
Print s
End Sub
余数超过9之后,应该用 大写字母 A B C D 依次排列。在ASCII码中 A对应的数字为65。余数如果为10的话,那么在数值相差55 。