三个数大小的比较
2012-05-29 20:55
106 查看
在窗体上插入三个文本框,一个按钮,输入代码:
Private SubCommand1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = Text1.Text
b = Text2.Text
c = Text3.Text
If a > bThen
Max = a
Else
Max = b
End If
If c > MaxThen
Max = c
End If
Print Max
End Sub
这个程序比较简单,通过使用If函数可以较简单的得出所需的结果。
Private SubCommand1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = Text1.Text
b = Text2.Text
c = Text3.Text
If a > bThen
Max = a
Else
Max = b
End If
If c > MaxThen
Max = c
End If
Print Max
End Sub
这个程序比较简单,通过使用If函数可以较简单的得出所需的结果。