十进制转化为十六进制
2016-05-07 17:39
465 查看
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim yushu As Byte
Dim s As String
a = 1230
b = 16
While a <> 0
a = a \ b
yushu = a Mod b
s = f(yushu) & s
Wend
Print s
End Sub
Private Function f(yushu As Byte) As String
If yushu <= 9 Then
f = yushu
Else
Select Case yushu
Case 10, 11, 12, 13, 14, 15
f = Chr(yushu + 55)
End Select
End If
End Function
Dim a As Integer
Dim b As Integer
Dim yushu As Byte
Dim s As String
a = 1230
b = 16
While a <> 0
a = a \ b
yushu = a Mod b
s = f(yushu) & s
Wend
Print s
End Sub
Private Function f(yushu As Byte) As String
If yushu <= 9 Then
f = yushu
Else
Select Case yushu
Case 10, 11, 12, 13, 14, 15
f = Chr(yushu + 55)
End Select
End If
End Function
相关文章推荐
- jQuery mobile 监听页面的各种生命周期
- 比较数的大小(选择法)
- 10个随机数
- 【转】SVN的UUID错误
- SSH-Web项目中 .classpath、.mymetadata、.project文件的作用
- 【Raspberry Pi 3试用体验】+编译opencv
- 2015阿里&看雪移动安全挑战赛-第一题
- STL学习——set/map/multiset/mulitmap篇
- 选择排序法
- 播放图片动画
- Git Step By Step - Step 3: Branching
- Android 判断json格式, 将错误信息提交给服务器
- 比较数的大小(冒泡法)
- 十进制向十六进制转化
- 《JavaScript Ninja》之函数是根基
- 选择排序法
- google gflags 库完全使用
- windows下C++多线程学习之一(多线程基础)
- 【BestCoder Round #82 (div.2)】HDU5675ztr loves math
- 十进制改成十六进制