15 电气 2012 十进制化16进制 官方化法
2016-05-07 17:21
309 查看
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 / 定义 f 用 ABCDE表示16进制
If yushu <= 9 Then
f = yushu
Else
Select Case yushu
Case 10, 11, 12, 13, 14, 15
f = Chr(yushu + 55) / 用ASCII 码表示 ABCDE 用Chr 函数 返回ASCII码对应字符
End Select
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 / 定义 f 用 ABCDE表示16进制
If yushu <= 9 Then
f = yushu
Else
Select Case yushu
Case 10, 11, 12, 13, 14, 15
f = Chr(yushu + 55) / 用ASCII 码表示 ABCDE 用Chr 函数 返回ASCII码对应字符
End Select
End If
End Function
相关文章推荐
- [Nutch]使用LUKE查看Solr的索引文件内容
- 230的16进制
- 斐波那契数列、跳台阶、变态跳台阶、矩形覆盖
- HDU-1394 Minimum Inversion Number 树状数组
- android 获取网络图片生成二维码
- VC2013生成的程序兼容WindowsXP操作系统
- 把检测出的人脸用椭圆和矩形框画出
- html5新增加的input类型元素
- Android Studio分渠道打包
- 多生产者多消费者问题(Lock接口、Condition接口)
- 判断ImageView当前是否使用指定的某一张图片
- 2015-2016 下半学期 第八周 训练
- CodeForces 165A Supercentral Point(水题)
- 单一职责原则
- [android] 手机卫士接收打电话广播显示号码归属地
- prototype中美元符号$的有关用法
- 十进制转化成十六进制i
- HDU 4165 Pills (DP卡特兰数列)
- 几进制的转换
- html5新增加的表单元素-output