Объяснение:
const
n = 100;
var
a:array[1..n] of integer;
i, k, d:integer;
begin
k:=1;
d:=1;
for i:= 1 to n do begin
a[i]:=k;
if (i = 50) then begin
d:=-1;
k:=k+1;
end;
k:=k + d;
for i:= 1 to n do
write(a[i], ' ');
readln;
end.
Объяснение:
const
n = 100;
var
a:array[1..n] of integer;
i, k, d:integer;
begin
k:=1;
d:=1;
for i:= 1 to n do begin
a[i]:=k;
if (i = 50) then begin
d:=-1;
k:=k+1;
end;
k:=k + d;
end;
for i:= 1 to n do
write(a[i], ' ');
readln;
end.