Почему выдает (встречно 'until', а ожидалось ';')

Var a:array[1..50] of byte;
n,p, i,k,m,j,x,y,z: integer;
begin
writeln('Введите количество элементов');
readln(p);
repead;
n:=4;
for i:=n downto 1 do begin
a[i]:=p mod 10;
p:= p div 10;
end;
For i:=1 To n-1 Do Begin
k := i;
For j := i + 1 To n Do
If a[j] >= a[k] Then
k := j;
m := a[i];
a[i] := a[k];
a[k] := m;
end;
x:=a[1]*1000+a[2]*100+a[3]*10+a[4];
For i := 1 To N - 1 Do Begin
k := i;
For j := i + 1 To n Do
If a[j] <= a[k] Then
k := j;
m := a[i];
a[i] := a[k];
a[k] := m;
end;
y:=a[1]*1000+a[2]*100+a[3]*10+a[4];
z:=x-y;
until z=p;
writeln(z);

end.
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Copyright © 2024 SCHOLAR.TIPS - All rights reserved.