const
n=5;
m=6;
var
a : array [0..n, 0..m] of integer;
sum, pr, i, j : integer;
begin
randomize;
sum:=0;
pr:=1;
for j:=0 to m-1 do begin
for i:=0 to n-1 do begin
a[i,j] := random(100) - 50;
if (a[i,j] mod 4 = 0) and (a[i,j] mod 7 = 0) then begin
sum:=sum+a[i,j];
pr:=pr*a[i,j];
end;
write(a[i, j], ' ');
writeln();
writeln('');
writeln('Сумма = ',sum);
writeln('Произведение = ', pr);
end.
const
n=5;
m=6;
var
a : array [0..n, 0..m] of integer;
sum, pr, i, j : integer;
begin
randomize;
sum:=0;
pr:=1;
for j:=0 to m-1 do begin
for i:=0 to n-1 do begin
a[i,j] := random(100) - 50;
if (a[i,j] mod 4 = 0) and (a[i,j] mod 7 = 0) then begin
sum:=sum+a[i,j];
pr:=pr*a[i,j];
end;
write(a[i, j], ' ');
end;
writeln();
end;
writeln('');
writeln('Сумма = ',sum);
writeln('Произведение = ', pr);
end.