1)
uses crt;
const
n=5;m=7;
var
i,j,s:integer;
a:array[1..n,1..m]of integer;
begin
randomize;
clrscr;
for i:=1 to n do
begin
for j:=1 to m do
begin
a[i,j]:=random(40)-19;
write(a[i,j]:4);
end;
writeln;
end;
writeln;
for j:=1 to m do
begin
s:=0;
for i:=1 to n do
s:=s+a[i,j];
writeln ('j:',j,' ', s);
writeln;
end;
end.