Найти количество строк, в которых количество отрицательных элементов больше, чем количество положительных — Pascal(Паскаль)

Const
  N = 3;
  M = 3;
  Matrix: Array[1..N,1..M] of Integer = ((-11,92,63),(-24,-45,6),(97,81,29));
Var
  Negative,Positive: Integer;
  i,j,Rows: Integer;
begin
 Rows := 0;
 for i := 1 to N
 do begin
    Negative := 0;
    Positive := 0;
    for j := 1 to M
    do if Matrix[i,j] < 0
       then Inc(Negative)
       else Inc(Positive);
    if Negative > Positive
    then Inc(Rows)
    end;
 WriteLn(Rows:4);
 ReadLn;
end.

Leave a Comment

4 + 5 =