Const n=50;
var a: array[1..n] of integer;
p,i: integer;
begin
write('p (-1,0,1) = ');
readln(p);
case p of
1: for i:=1 to n do a[i]:=random(100);
0: for i:=1 to n do a[i]:=i+101;
-1: begin for i:=1 to n do read(a[i]); readln; end;
end;
writeln;
writeln('Исходный массив:');
for i:=1 to n do write(a[i],' ');
writeln;
end.
Пример (для n=5):
p (-1,0,1) = 0
Исходный массив:
102 103 104 105 106