选择法排序
2016-05-12 16:48
417 查看
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim s As String
Dim yushu As Integer
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 Integer) 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 s As String
Dim yushu As Integer
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 Integer) 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
相关文章推荐
- seo优化 标点符号
- 使用Visual Studio 2013进行单元测试--初级篇(转http://***/Article/11186)
- Ubuntu Server 15.04的安装
- Java第六次实验
- 安装opensuse的笔记-重庆linux开源组织
- 移动app开发中多种设备尺寸适配问题
- C#学习笔记之图片、字节数组、base64之间的转换
- 动态代理实现
- JS函数的定义与调用方法推荐
- zookeeper数据模型
- 图解JSP与Servlet的关系
- 多线程下载
- gossip 算法学习总结
- 栈的应用之检测平衡符号
- 第十周项目4——教师兼干部类
- 关于SwiperefreshLayout使用
- 数据库大型应用解决方案总结
- 1111
- 基于DFS的拓扑排序
- HTML5 之前的视频播放格式