//Turbo Pascal uses crt;const n=20;type massiv=array[1..n] of integer;varsum:integer;i,max,min:integer;a:massiv;beginclrscr;randomize;for i:=1 to n doa[i]:=random(20);writeln('Massiv: ');for i:=1 to n dowrite(a[i]:3);writeln;max:=a[1];min:=a[1];for i:=2 to n doif (a[i]>max) then max:=a[i]else if (a[i]<min) then min:=a[i];sum:=max+min;writeln('Max: ', max, ' Min: ', min);writeln('Summa= ',sum);readln;end.