32714107 发表于 2012-9-24 11:15:25

为什么会出现语法错误?(已解决)

本帖最后由 32714107 于 2013-4-29 22:44 编辑

Local $i, $n, $r
$n = InputBox("Input", "To what number do you want to add up?")
$r = 0
$i = 0
Do $i = $i + 1
        $r = $r + $i
Until $i >= $n
MsgBox(0, "Output", "The sum from 1 to " & $n & " is " & $r)

annybaby 发表于 2012-9-24 11:30:24

Local $i, $n, $r
$n = InputBox("Input", "To what number do you want to add up?")
$r = 0
$i = 0
Do
        $i = $i + 1
      $r = $r + $i
Until $i >= $n
MsgBox(0, "Output", "The sum from 1 to " & $n & " is " & $r)

annybaby 发表于 2012-9-24 11:31:26

回复 1# 32714107


   请注意DO--until的用法格式~~

32714107 发表于 2012-9-24 12:14:47

谢谢annybaby 前辈!
页: [1]
查看完整版本: 为什么会出现语法错误?(已解决)