const
n=3;m=4;
var
a:array [1..n+1,1..m] of integer;
i,j:integer;
begin
for i:=1 to n do
for j:=1 to m do
readln(a[i,j]);
if a[i,j]>0 then
inc(a[n+1,j]);
end;
writeln;
for i:=1 to n+1 do
write(a[i,j]:4);
if i<>n then
writeln
else
writeln('Счётчик:');
end.
const
n=3;m=4;
var
a:array [1..n+1,1..m] of integer;
i,j:integer;
begin
for i:=1 to n do
begin
for j:=1 to m do
begin
readln(a[i,j]);
if a[i,j]>0 then
inc(a[n+1,j]);
end;
writeln;
end;
for i:=1 to n+1 do
begin
for j:=1 to m do
write(a[i,j]:4);
if i<>n then
writeln
else
begin
writeln;
writeln('Счётчик:');
end;
end;
end.