Var matrix1:array [,] of real; n:integer; tmp:real;
begin
write('Введи размерность матрицы:');
readln(n);
matrix1:=new real[n,n];
for var i:=0 to n-1 do begin
for var j:=0 to n-1 do
begin
matrix1[i,j]:=Random(100);
write(matrix1[i,j]:4);
end;
writeln;
end;
writeln('Поменяли:');
for var j:=0 to n-1 do
begin
tmp:=matrix1[j,n-1];
matrix1[j,n-1]:=matrix1[n-1,j];
matrix1[n-1,j]:=tmp;
end;
for var i:=0 to n-1 do begin
for var j:=0 to n-1 do
write(matrix1[i,j]:4);
writeln;
end;
end.