Pascal
program xxx;
var a: array [1..20, 1..20] of real;
i, j, n, m : integer;
s, p : real;
begin
writeln ('введите n=');
readln (n);
writeln ('введите m=');
readln (m);
s:=0;
p:=1;
for i:= 1 to n do
for j:= 1 to m do
begin
readln (a[i,j]);
if a[i,j]<>0 then begin
s:=s+a[i,j]; p:=p* a[i,j]
end
end;
writeln('сумма элементов =', s);
writeln ('произведение элементов =',p)
end.