program fantscrin;
const n = 10;
var a: array [1..n] of integer;
b: array [1..n] of integer;
max_a,max_b,i,k:integer;
begin
for i:=1 to n do
a[i]:=random(20);
b[i]:=random(20);
write(a[i], ' ');
writeln('');
write(b[i], ' ');
max_a:=1;
for i:=2 to n do
if(a[i]>a[max_a]) then max_a:=i;
max_b:=1;
if(b[i]>b[max_b]) then max_b:=i;
writeln('Max_a = ',max_a);
writeln('Max_b = ',max_b);
k:=a[max_a];
a[max_a]:=b[max_b];
b[max_b]:=k;
end.
program fantscrin;
const n = 10;
var a: array [1..n] of integer;
b: array [1..n] of integer;
max_a,max_b,i,k:integer;
begin
for i:=1 to n do
a[i]:=random(20);
for i:=1 to n do
b[i]:=random(20);
for i:=1 to n do
write(a[i], ' ');
writeln('');
for i:=1 to n do
write(b[i], ' ');
max_a:=1;
for i:=2 to n do
if(a[i]>a[max_a]) then max_a:=i;
max_b:=1;
for i:=2 to n do
if(b[i]>b[max_b]) then max_b:=i;
writeln('');
writeln('Max_a = ',max_a);
writeln('Max_b = ',max_b);
k:=a[max_a];
a[max_a]:=b[max_b];
b[max_b]:=k;
for i:=1 to n do
write(a[i], ' ');
writeln('');
for i:=1 to n do
write(b[i], ' ');
end.