变量交换

来源:互联网 发布:ts中怎么定义一个数组 编辑:程序博客网 时间:2024/04/30 10:28

打开VB图标,点击commond按钮,画出一个方框来,双击后输入以下内容:

Private Sub Command1_Click()

Cls
Me.Font.Size = 50
Dim b As Integer, c As Integer

Dim d 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

End Sub
0 0