pascalabcnet/TestSuite/while1.pas
Бондарев Иван e6e67c193c initial commit
2015-05-14 21:35:07 +02:00

28 lines
397 B
ObjectPascal

begin
var i := 1;
var s := 0;
while i < 5 do
begin
s := s + i;
Inc(i);
end;
assert(s=10);
var flag := false;
while not flag do
begin
i := 3;
flag := true;
end;
assert(i=3);
var enum: (one, two, three) := one;
while enum < three do
begin
Inc(enum);
end;
assert(enum = three);
i := 0;
var arr: array of integer;
SetLength(arr,5);
while (i<5) and (arr[i] = 0) do Inc(i);
assert(i=5);
end.