Const
n = 2; m = 5;
var
a: array [1..n, 1..m] of integer;
i, j, x: integer;
begin
writeln('Исходная матрица: ');
for i := 1 to n do
begin
for j := 1 to m do
begin
a[i, j] := random(15) + 1;
write(a[i, j]:4);
end;
writeln;
end;
for j := 1 to m do
begin
x := a[1, j];
a[1, j] := a[2, j];
a[2, j] := x;
end;
writeln;
writeln('Итоговая матрица: ');
for i := 1 to n do
begin
for j := 1 to m do
write(a[i, j]:4);
writeln;
end;
end.