Const nx=30;mx=30;
var i,j,n,m:integer;A:array[1..nx,1..mx] of integer;B,D:array[1..nx] of integer;
begin
write('Введите n');Readln(n);
write('Введите m');Readln(m);
for i:=1 to n do begin
for j:=1 to m do вegin
A[i,j]:=random(100)-20;
write(A[i,j]:4);end;writeln;end;writeln;
for i:=1 to n do begin
for j:=1 to m do begin
if (A[i,j] mod 3 =0) then begin
B[i]:= B[i] + A[i,j];write(A[i,j]:4);D[i]:= D[i] + 1;end;end;writeln;end;
for i:=1 to n do begin
if (B[i]=0) and (D[i]= 0) then B[i]:= -10;
write(B[i]:4);end;end.