代码请见:dim $a,$b,$c
dim $t
$a = inputbox("例子","请输入第一个整数:","","",50,50)
$b = inputbox("例子","请输入第二个整数:","","",50,50)
$c = inputbox("例子","请输入第三个整数:","","",50,50)
if @error = 1 then Exit
if $a = "" then Exit
if $b = "" then Exit
if $c = "" then Exit
if $a > $b then
$t=$a
$a=$b
$b=$t
EndIf
if $a>$c Then
$t=$a
$a=$c
$c=$t
EndIf
if $b>$c Then
$t=$b
$b=$c
$c=$t
EndIf
msgbox(0,"例子","从小到大排列:"&$a&","&$b&","&$c)
当我们依次输入10,30,20,是能正常排列由小到大。
当你依次输入100,150,30,的时候你就会发现不能正常排列由小到大的排列了。
请问下我这个代码错了吗?
如果那里错了请给我修正下好吗?感谢各位。
[ 本帖最后由 laojikelly 于 2009-4-13 21:40 编辑 ] |