16进制
2016-05-07 17:46
253 查看
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 。
2..
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
s = f(yushu) & s
a = a \ b
Wend
Print s
End Sub
Private Function f(yushu As Byte) As String
If yushu <= 9 Then
f = yushu
Else
f = Chr(yushu + 55)
End If
End Function
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 。
2..
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
s = f(yushu) & s
a = a \ b
Wend
Print s
End Sub
Private Function f(yushu As Byte) As String
If yushu <= 9 Then
f = yushu
Else
f = Chr(yushu + 55)
End If
End Function
相关文章推荐
- java基础类型
- 选择法排序
- 选择法排序
- 随机十个数的排序,选择法排序
- 十进制改为十六进制
- lua类的继承
- github做版本控制的时候 由于本地做了修改无法切换分支
- 简单总结C语言中的运算符优先级
- synchronized-当执行内部代码时,锁定当前对象
- GLSL学习教程博客
- WaveSwipeRefreshLayout实现微信热文精选,微信热文安卓app版,activity中viewpager套fragment
- 部署禅道数据库报错
- 关于ArrayList的remove
- zabbix应用---检查ssh登录ip
- 冒泡法 15电气 2012
- 十进制向十六进制转化.
- 选择法
- 在ASP.NET 2.0中操作数据之二十六:排序自定义分页数据
- boost::filesystem
- UVA, 112Tree Summing