Difference between revisions of "Basic Pascal Tutorial/Chapter 3/REPEAT..UNTIL/zh CN"
From Free Pascal wiki
Jump to navigationJump to searchm (Kai Burghardt moved page REPEAT..UNTIL/zh CN to Basic Pascal Tutorial/Chapter 3/REPEAT..UNTIL/zh CN: tidy up main name space: create subpage hierarchy for basic Pascal tutorial [cf. [[Special: Perm...) |
m (bypass language bar/categorization template redirect [cf. discussion]) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{REPEAT..UNTIL}} | + | {{Basic Pascal Tutorial/Chapter 3/REPEAT..UNTIL}} |
REPEAT..UNTIL循环 (原作者: Tao Yue, 状态: 未更改) | REPEAT..UNTIL循环 (原作者: Tao Yue, 状态: 未更改) | ||
Line 35: | Line 35: | ||
{|style=color-backgroud="white" cellspacing="20" | {|style=color-backgroud="white" cellspacing="20" | ||
− | |[[WHILE..DO/zh_CN|上一页]] | + | |[[Basic Pascal Tutorial/Chapter 3/WHILE..DO/zh_CN|上一页]] |
− | |[[Contents/ | + | |[[Basic Pascal Tutorial/Contents/zh CN|目录]] |
− | |[[FOR..IN/zh_CN|下一页]] | + | |[[Basic Pascal Tutorial/Chapter 3/FOR..IN/zh_CN|下一页]] |
|} | |} |
Latest revision as of 16:19, 20 August 2022
│
български (bg) │
English (en) │
français (fr) │
日本語 (ja) │
中文(中国大陆) (zh_CN) │
REPEAT..UNTIL循环 (原作者: Tao Yue, 状态: 未更改)
先循环后判断:
repeat
语句1;
语句
until 逻辑表达式;
在repeat循环中,复合语句是内置的,因此,你不需要使用begin-end。另外,直至表达式值为真退出循环。
REPEAT循环被称之为先循环后判断,任何情况下,循环至少执行一次。
var
sum,count : integer;
begin
sum := 0;
count := 0;
repeat
count := count + 1;
sum := sum + count
until (count >= 100);
writeln('sum=', sum);
end.
上一页 | 目录 | 下一页 |