求最大数的简单程序设计(源码)
时间:11-19 14:19 阅读:709次
*温馨提示:点击图片可以放大观看高清大图
简介:本文主要介绍了求最大数的简单程序设计(源码)
Private Sub Command1_Click()
Dim x1 As Single, x2 As Single, x3 As Single
Dim a As Single
x1 = Val(Text1.Text)
x2 = Val(Text2.Text)
x3 = Val(Text3.Text)
Call max(x1, x2, x3, a)
Label4.Caption = "最大值是" & a
End Sub
Private Sub max(x As Single, y As Single, z As Single, maxx As Single)
maxx = x
If y > maxx Then
maxx = y
If z > maxx Then
maxx = zEnd Sub