交换两个数字
1.双击打开桌面上的VB6.0;
2.在工具箱窗口找到commandbutton的图标并点击,在窗体上单机拖动划出一个按钮,此时这个按钮名字为“command1”;
3.双击刚做出的 “command1”,在弹出的框框里输入代码:
Cls
Dim b As Integer, c As Integer
c = Int(Rnd() * 1000)
b = Int(Rnd() * 1000)
Print "b" & b
Print "c" & c
d = c
c = b
b = d
Print "b" & b
Print "c" & c
4.点击运行,点击按钮即可看到两个数字交换的结果。
587




被折叠的 条评论
为什么被折叠?



