uses crt;
const n=5;
var a:array[1..2*n,1..2*n]of byte;
i,j,x:byte;
begin
clrscr;
randomize;
writeln('Исходная матрица');
for i:=1 to 2*n do
begin
for j:=1 to 2*n do
begin
a[i,j]:=10+random(90);
write(a[i,j]:3);
end;
writeln;
end;
for i:=1 to n do
for j:=1 to n do
begin
x:=a[i,j];
a[i,j]:=a[n+i,n+j];
a[n+i,n+j]:=x;
x:=a[i,n+j];
a[i,n+j]:=a[n+i,j];
a[n+i,j]:=x;
end;
writeln('Перестановка блоков');
for i:=1 to 2*n do
begin
for j:=1 to 2*n do
write(a[i,j]:3);
writeln;
end;
readln
end.
const n=5;
var a:array[1..2*n,1..2*n]of byte;
i,j,x:byte;
begin
clrscr;
randomize;
writeln('Исходная матрица');
for i:=1 to 2*n do
begin
for j:=1 to 2*n do
begin
a[i,j]:=10+random(90);
write(a[i,j]:3);
end;
writeln;
end;
for i:=1 to n do
for j:=1 to n do
begin
x:=a[i,j];
a[i,j]:=a[n+i,n+j];
a[n+i,n+j]:=x;
x:=a[i,n+j];
a[i,n+j]:=a[n+i,j];
a[n+i,j]:=x;
end;
writeln('Перестановка блоков');
for i:=1 to 2*n do
begin
for j:=1 to 2*n do
write(a[i,j]:3);
writeln;
end;
readln
end.