VAR
n, m, sum, i, j: Integer;
a: Array [1..10000] of Array [1..10000] of Integer;
BEGIN
Read(n, m);
For i := 1 to n do
For j := 1 to m do Read(a[i][j]);
For i := 1 to n do
For j := 1 to m do
If (a[i][j] > 0) then sum := sum + a[i][j];
Write(sum);
END.
Но для экономии времени и сил можно не создавать массив:
VAR
n, m, sum, el, i, j: Integer;
BEGIN
Read(n, m);
For i := 1 to n do
For j := 1 to m do begin
Read(el);
If (el > 0) then sum := sum + el;
End;
Write(sum);
END.