program fantscrin;
const n = 10;
var a: array [1..n] of integer;
i,min,max:integer;
Begin
for i:=1 to n do
a[i]:= random(41)-20;
write(a[i], ' ');
min:=a[1];
if (a[i]<min) then min:=a[i];
max:=a[1];
if (a[i]>max) then max:=a[i];
writeln('');
writeln(min+max);
End.
program fantscrin;
const n = 10;
var a: array [1..n] of integer;
i,min,max:integer;
Begin
for i:=1 to n do
a[i]:= random(41)-20;
for i:=1 to n do
write(a[i], ' ');
min:=a[1];
for i:=1 to n do
if (a[i]<min) then min:=a[i];
max:=a[1];
for i:=1 to n do
if (a[i]>max) then max:=a[i];
writeln('');
writeln(min+max);
End.