16进制
2016-05-07 17:43
295 查看
Private Sub Command1_Click()
Me.Font.Size = 20
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
Select Case yushu
Case 10, 11, 12, 13, 14, 15
f = Chr(yushu + 55)
End Select
End If
End Function
Me.Font.Size = 20
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
Select Case yushu
Case 10, 11, 12, 13, 14, 15
f = Chr(yushu + 55)
End Select
End If
End Function
相关文章推荐
- vb(选择法排序)
- 《JavaScript Ninja》之挥舞函数
- Servlet中使用RequestDispatcher调派请求--include
- Oracle学习系列7
- Javaweb容器的四种作用域
- [Android]为TextView提供双色文本配置的小工具ColorPhrase
- H5开发学习 ---- sublime text 使用
- 求助: Android 加载 webview, 点击webview 中网页时间, 如何触发 Android 事件
- 计算机漏洞安全相关的概念POC | EXP | VUL | CVE | 0DAY
- 随机产生10个数,并使用选择法,由大到小排序
- 0基础如何学习安卓开发
- 数据结构X实验一
- CSS 布局模型
- hdoj2045动态规划
- VS2008高版本VC使用微软串口控件mscomm小结
- c++实验5-项目1数组分离
- 排列组合列出所有情况之类的问题
- 16进制
- 10的阶乘
- [SICP]函数定义