welleyth

8525. Четные отрицательные в матрице

Dec 2nd, 2020
749
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var i,j,n,m,sum,counter:int64;
  2.     A : array[0..1000,0..1000] of int64;
  3. begin
  4.  
  5.     readln(n);
  6.  
  7.     sum := 0;
  8.     counter := 0;
  9.  
  10.     for i:=1 to n do
  11.     begin
  12.         for j:=1 to n do
  13.         begin
  14.                 read(A[i,j]);
  15.                 if (A[i,j] < 0) and (A[i,j] mod 2 = 0) then
  16.                 begin
  17.                     sum := sum + A[i,j];
  18.                     counter := counter + 1;
  19.                 end;
  20.         end;
  21.         readln()
  22.     end;
  23.  
  24.     writeln(counter,' ',sum);
  25.  
  26. end.
RAW Paste Data