laojikelly 发表于 2009-4-13 21:13:34

Let's autoit中由小到大怎么不能正常排列呢?

代码请见: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 编辑 ]

顽固不化 发表于 2009-4-13 21:21:56

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)

laojikelly 发表于 2009-4-13 21:40:28

谢谢你...原来是这样...
还没把let's autoit完全看明白...
再次谢谢...
:face (38):

skyfree 发表于 2009-4-15 10:56:18

把代码抄对……谢谢,这些代码我都核实过不只一次
页: [1]
查看完整版本: Let's autoit中由小到大怎么不能正常排列呢?