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
比较3个数的大小
最新推荐文章于 2022-03-30 21:56:38 发布