procedure MatInput(M:array[,] of integer); begin var nr:=Length(M,0); var nc:=Length(M,1); WritelnFormat('Введите построчно массив размером {0}x{1}',nr,nc); for var i:=0 to nr-1 do for var j:=0 to nc-1 do Read(M[i,j]); end;
function S(M:array[,] of integer):integer; begin Result:=0; var Zero:integer; for var i:=0 to Length(M,0)-1 do begin Zero:=1; for var j:=0 to Length(M,1)-1 do if M[i,j]=0 then begin Zero:=0; Break end; Result+=Zero; if Result=1 then begin Result:=0; Exit end end; Result:=1 end;
begin var A:=new integer[3,4]; MatInput(A); var B:=new integer[3,3]; MatInput(B); Writeln(S(A)); Writeln(S(B)); end.
procedure MatInput(M:array[,] of integer); begin var nr:=Length(M,0); var nc:=Length(M,1); WritelnFormat('Введите построчно массив размером {0}x{1}',nr,nc); for var i:=0 to nr-1 do for var j:=0 to nc-1 do Read(M[i,j]); end;
function S(M:array[,] of integer):integer; begin Result:=0; var Zero:integer; for var i:=0 to Length(M,0)-1 do begin Zero:=1; for var j:=0 to Length(M,1)-1 do if M[i,j]=0 then begin Zero:=0; Break end; Result+=Zero; if Result=1 then begin Result:=0; Exit end end; Result:=1 end;
begin var A:=new integer[3,4]; MatInput(A); var B:=new integer[3,3]; MatInput(B); Writeln(S(A)); Writeln(S(B)); end.