Var ma:array[1..n,1..m] of integer; i,j,sum,co:integer; begin randomize; writeln('Matrix:'); for i:=1 to n do begin for j:=1 to m do begin ma[i,j]:=random(10)-3; write(ma[i,j]:4); end; writeln; end; for j:=1 to m do begin for i:=1 to n do if ma[i,j]>0 then begin sum:=sum+ma[i,j]; inc(co); end; writeln('Sum ',j,':',sum); writeln('Count ',j,':',co); sum:=0; co:=0; end; end.
Const
n=15;
m=10;
Var
ma:array[1..n,1..m] of integer;
i,j,sum,co:integer;
begin
randomize;
writeln('Matrix:');
for i:=1 to n do
begin
for j:=1 to m do
begin
ma[i,j]:=random(10)-3;
write(ma[i,j]:4);
end;
writeln;
end;
for j:=1 to m do
begin
for i:=1 to n do
if ma[i,j]>0 then
begin
sum:=sum+ma[i,j];
inc(co);
end;
writeln('Sum ',j,':',sum);
writeln('Count ',j,':',co);
sum:=0;
co:=0;
end;
end.