const
n=5;
var
a:array [1..n,1..n] of integer;
i,j,sum:integer;
begin
sum:=0;
for i:=n downto 1 do
for j:=n downto 1 do
a[i,j]:=random(101)-50;
if abs(a[i,j])< abs(a[5,5]) then
sum:=sum+a[i,j];
end;
for i:=1 to n do
for j:=1 to n do
write(a[i,j]:4);
writeln;
write('Sum: ',sum);
end.
const
n=5;
var
a:array [1..n,1..n] of integer;
i,j,sum:integer;
begin
sum:=0;
for i:=n downto 1 do
for j:=n downto 1 do
begin
a[i,j]:=random(101)-50;
if abs(a[i,j])< abs(a[5,5]) then
sum:=sum+a[i,j];
end;
for i:=1 to n do
begin
for j:=1 to n do
write(a[i,j]:4);
writeln;
end;
write('Sum: ',sum);
end.