
vb 程序输入三个数输出中间大小的那个数
这是我编的代码能运行但当a=5.3b=22.2c=69.2时显示的是“中间数是:5.3“求教高手这是为什么?回答满意还可以加分PrivateSubCommand1_Cli...
这是我编的代码 能运行 但当 a=5.3 b=22.2 c=69.2时显示的是“中间数是:5.3“ 求教高手这是为什么? 回答满意还可以加分
Private Sub Command1_Click()
Dim a, b, c As Single
n = "中间数是:"
a = Text1: b = Text2: c = Text3
If a >= b And b >= c Then
Text4 = n & b
ElseIf a >= c And c >= b Then
Text4 = n & c
ElseIf b >= a And a >= c Then
Text4 = n & a
ElseIf b >= c And c >= a Then
Text4 = n & c
ElseIf c >= b And b >= a Then
Text4 = n & b
ElseIf c >= a And a >= b Then
Text4 = n & a
Else
MsgBox "请重新输入"
End If
End Sub
二楼能解释一下为什么吗? 非常感谢 展开
Private Sub Command1_Click()
Dim a, b, c As Single
n = "中间数是:"
a = Text1: b = Text2: c = Text3
If a >= b And b >= c Then
Text4 = n & b
ElseIf a >= c And c >= b Then
Text4 = n & c
ElseIf b >= a And a >= c Then
Text4 = n & a
ElseIf b >= c And c >= a Then
Text4 = n & c
ElseIf c >= b And b >= a Then
Text4 = n & b
ElseIf c >= a And a >= b Then
Text4 = n & a
Else
MsgBox "请重新输入"
End If
End Sub
二楼能解释一下为什么吗? 非常感谢 展开
展开全部
Dim a as single, b as single, c As Single
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询