program Q2;
const
n = 5;
var
arr: array[1..n,1..n] of real;
i,j: byte;
a: real;
begin
randomize;
for i:=1 to n do begin
for j:=1 to n do begin
arr[i,j] := random();
write(arr[i,j]:4:1);
end;
writeln;
end;
writeln;
for i:=1 to n div 2 do
for j:=1 to n div 2 do
if i = j then begin
a := arr[i,j];
arr[i,j] := arr[n-i+1,n-j+1];
a[n-i+1,n-j+1] := a;
end;
for i:= (n div 2)+1 to n do
for j:=1 to n div 2 do
if j = n-i+1 then begin
a := arr[i,j];
arr[i,j] := arr[j,i];
arr[j,i] := a;
end;
for i:=1 to n do begin
for j:=1 to n do
write(arr[i,j]:4:1);
writeln;
end;
readln;
end.
const
n = 5;
var
arr: array[1..n,1..n] of real;
i,j: byte;
a: real;
begin
randomize;
for i:=1 to n do begin
for j:=1 to n do begin
arr[i,j] := random();
write(arr[i,j]:4:1);
end;
writeln;
end;
writeln;
for i:=1 to n div 2 do
for j:=1 to n div 2 do
if i = j then begin
a := arr[i,j];
arr[i,j] := arr[n-i+1,n-j+1];
a[n-i+1,n-j+1] := a;
end;
for i:= (n div 2)+1 to n do
for j:=1 to n div 2 do
if j = n-i+1 then begin
a := arr[i,j];
arr[i,j] := arr[j,i];
arr[j,i] := a;
end;
for i:=1 to n do begin
for j:=1 to n do
write(arr[i,j]:4:1);
writeln;
end;
readln;
end.