Const nx=30;var n,m,i,s,k,max,min:integer; z:array[1..nx] of integer;sr:real; begin write('введите n');read(n); max:= -100;min:= 100; for i:=1 to n do begin z[i]:= random(25)-15; if max < z[i] then begin max:= z[i];k:= i;end; if min > z[i] then begin min:= z[i];m:= i;end; write(z[i]:4);end; writeln; s:= z[k]; z[k]:= z[m]; z[m]:= s; for i:=1 to n do write(z[i]:4); writeln;writeln('max = ',max,' k =',k );writeln('min = ',min,' m =',m );end.
z:array[1..nx] of integer;sr:real;
begin
write('введите n');read(n); max:= -100;min:= 100;
for i:=1 to n do begin
z[i]:= random(25)-15;
if max < z[i] then begin max:= z[i];k:= i;end;
if min > z[i] then begin min:= z[i];m:= i;end;
write(z[i]:4);end;
writeln;
s:= z[k]; z[k]:= z[m]; z[m]:= s;
for i:=1 to n do write(z[i]:4);
writeln;writeln('max = ',max,' k =',k );writeln('min = ',min,' m =',m );end.