welleyth

8524. Сумма положительных на матрице

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