16进制的转换
2016-05-07 17:30
218 查看
Private Sub Command1_Click()
Me.Font.Size = 30
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
Me.Font.Size = 30
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
相关文章推荐
- php-生成验证码
- iOS保持界面流畅技巧文章阅读摘录
- Unicode(UTF-8, UTF-16)令人混淆的概念
- 9.2016.物电学院 电气一班 辛雅松 15050341033
- 数据库设计三大范式
- 深度学习之caffe环境搭建(3)
- Android 使用TabHost 无法显示图标
- Modernizr的介绍和使用
- 背包问题
- 单例模式
- Abp 数据过滤获取AbpUser表数据
- 深度学习之卷积神经网络入门(2)
- 十六进制
- CSS 入门
- 16 进制 郑明雨 15050341044
- 十进制转为十六进制
- 第10周学习进度
- 【hdu1247】Hat’s Words
- Android事件分发机制完全解析
- 矩阵快速幂