const
n=5;
var
a:array [1..n+2,1..n] of integer;
i,j:integer;
begin
for i:=1 to n do
for j:=1 to n do
a[i,j]:=random(41)-20;
write(a[i,j]:4);
if a[i,j]>0 then
inc(a[n+2,j]);
a[n+1,j]:=a[n+1,j]+a[i,j];
end;
writeln;
for i:=n+1 to n+2 do
end.
const
n=5;
var
a:array [1..n+2,1..n] of integer;
i,j:integer;
begin
for i:=1 to n do
begin
for j:=1 to n do
begin
a[i,j]:=random(41)-20;
write(a[i,j]:4);
if a[i,j]>0 then
begin
inc(a[n+2,j]);
a[n+1,j]:=a[n+1,j]+a[i,j];
end;
end;
writeln;
end;
writeln;
for i:=n+1 to n+2 do
begin
for j:=1 to n do
write(a[i,j]:4);
writeln;
end;
end.