比较3个数的大小
2016-03-31 17:33
239 查看
Private Sub Command1_Click()
Cls
Me.Font.Size = 24
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = Int(Rnd * 1000)
b = Int(Rnd * 1000)
c = Int(Rnd * 1000)
If a < b Then
Call swap(a, b)
End If
If a < c Then
Call swap(a, c)
End If
If b < c Then
Call swap(b, c)
End If
Print a & "," & b & "," & c &"," & d
End Sub
Private Sub swap(x As Integer, y As Integer)
Dim temp As Integer
If x < y Then
temp = x
x = y
y = temp
End If
End Sub
Cls
Me.Font.Size = 24
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = Int(Rnd * 1000)
b = Int(Rnd * 1000)
c = Int(Rnd * 1000)
If a < b Then
Call swap(a, b)
End If
If a < c Then
Call swap(a, c)
End If
If b < c Then
Call swap(b, c)
End If
Print a & "," & b & "," & c &"," & d
End Sub
Private Sub swap(x As Integer, y As Integer)
Dim temp As Integer
If x < y Then
temp = x
x = y
y = temp
End If
End Sub
相关文章推荐
- jquery.validate form 基本使用
- 开源mqtt代理:mosquitto
- HTML学习笔记(六)列表
- UI控件--Toast
- 数据库单条记录并发读并更改问题
- 使用虚拟机安装RHEL7.1详细教程
- android launchmode 使用场景
- SVN服务器搭建和使用(一)
- arm-linux内核编译出错
- focusky 购买指南
- mybatis 使用@Select 注解,因为字符编码不一致导致mybatis 报错
- zookeeper部署和管理
- 转:Web App开发入门
- DEV GridControl表格数据源为空在表格中间显示提醒字符
- jboss-as-7.1.1.Final:(二)远程调试设置
- QLineF
- unity3d Physics
- 排列15个数的大小
- Activity管理Fragment之Fragment关闭当前回到之前Fragment
- 检测移动设备横竖屏