Repeat循环

语法

repeat
   sum := sum + number;
   number := number -2;
until number =0;

流程图

pascal repeat until loop

官方样例

program repeatUntilLoop;
var
   a: integer;
begin
   a :=10;
   // repeat until loop execution //
   repeat
      writeln('value of a: ', a);
      a := a +1
   until a = 20;
end.

运行结果

value of a: 10
value of a: 11
value of a: 12
value of a: 13
value of a: 14
value of a: 15
value of a: 16
value of a: 17
value of a: 18
value of a: 19
Copyright © 280i.com 2020 all right reserved,powered by Gitbook本书建立时间: 2020-04-11 21:10:53

results matching ""

    No results matching ""