Uses crt;const n=5;var a:array[1..n] of integer; i,max,min: integer;begin clrscr;for i := 1 to n do begina[i]:=random(20);write(a[i]:4);end;for i := 1 to n do beginmin:=maxint;if a[i]>max then max:=a[i];if a[i]<min then min:=a[i];end;writeln;for i := 1 to n do beginif ((a[i]=max) or (a[i]=min)) then a[i]:=max+min;write(a[i]:4);end; writeln;writeln('max = ', max, ' min = ', min);end.