const n=20;
var a: array[1..n] of integer;
max,min,i: integer;
begin
Randomize;
for i:=1 to n do
a[i]:=random(201)-100;
write(a[i],' ');
end;
writeln;
min:=a[1];
max:=a[1];
for i:=2 to n do
if a[i]<min then min:=a[i];
if a[i]>max then max:=a[i];
writeln('min = ',min,' max = ',max);
end.
const n=20;
var a: array[1..n] of integer;
max,min,i: integer;
begin
Randomize;
for i:=1 to n do
begin
a[i]:=random(201)-100;
write(a[i],' ');
end;
writeln;
min:=a[1];
max:=a[1];
for i:=2 to n do
begin
if a[i]<min then min:=a[i];
if a[i]>max then max:=a[i];
end;
writeln('min = ',min,' max = ',max);
end.