Const
maxn = 4;
maxm = 5;
type
myarr = array [1..maxn, 1..maxm] of longint;
var
a: myarr;
sum, i, j: longint;
begin
for i := 1 to 4 do begin
for j := 1 to 5 do begin
a[i, j] := i * j;
write(a[i, j], ' ');
end;
writeln;
end;
sum := 0;
for j := 1 to 5 do begin
for i := 1 to 4 do
if (a[i, j] mod 3 = 0) then
sum := sum + a[i, j];
writeln('Сумма чисел, кратных 3, в ', j, ' столбце равна ', sum);
sum := 0;
end;
end.