Let's autoit中由小到大怎么不能正常排列呢?
代码请见:dim $a,$b,$cdim $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 编辑 ] dim $a,$b,$c
dim $t
$a = Number(inputbox("例子","请输入第一个整数:","","",50,50))
$b = Number(inputbox("例子","请输入第二个整数:","","",50,50))
$c = Number(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) 谢谢你...原来是这样...
还没把let's autoit完全看明白...
再次谢谢...
:face (38): 把代码抄对……谢谢,这些代码我都核实过不只一次
页:
[1]