Var
i,x:integer;
m:array[10..20] of integer;
begin
randomize;
for i:=10 to 20 do m[i]:=random(11)+10;
for i:=10 to 20 do write(m[i],' ');
writeln;
x:=m[10];
m[10]:=m[20];
m[20]:=x;
for i:=10 to 20 do write(m[i],' ');
writeln;
end.
2)
var
max,min,i,x:integer;
m:array[10..20] of integer;
begin
min:=10;
max:=10;
randomize;
for i:=10 to 20 do m[i]:=random(100)+1;
for i:=10 to 20 do write(m[i],' ');
writeln;
for i:=10 to 20 do begin if m[i]if m[i]>m[max] then max:=i;
end;
x:=m[min];
m[min]:=m[max];
m[max]:=x;
for i:=10 to 20 do write(m[i],' ');
writeln;
end.