作业帮 > 综合 > 作业

VB操作题.从键盘任意输入四个数,求四个数中的最大值

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/04/29 00:24:55
VB操作题.从键盘任意输入四个数,求四个数中的最大值
提示,可以采用“两两比较”的方法,找出最大值
Private Sub Command1_Click()
If Val(Text1.Text) < Val(Text2.Text) Then Text1.Text = Text2.Text
If Val(Text3.Text) < Val(Text4.Text) Then Text3.Text = Text4.Text
If Val(Text1.Text) < Val(Text3.Text) Then Text1.Text = Text3.Text
Text2.Visible = False
Text3.Visible = False
Text4.Visible = False
End Su