迴圈的反向
for
迴圈從起始值向下迭代到包含終止值,作為倒計時示例。
program CountDown;
{$APPTYPE CONSOLE}
var
i : Integer;
begin
for i := 10 downto 0 do
WriteLn(i);
end.
輸出:
10
9
8
7
6
5
4
3
2
1
0
for
迴圈從起始值向下迭代到包含終止值,作為倒計時示例。
program CountDown;
{$APPTYPE CONSOLE}
var
i : Integer;
begin
for i := 10 downto 0 do
WriteLn(i);
end.
輸出:
10
9
8
7
6
5
4
3
2
1
0