Find the sum of all positive elements of the matrix. in pascal

program zz1;
const n = 3; // set the size of the matrix
var matr: array [1..n, 1..n] of integer;
i, j, s: integer;
begin
for i: = 1 to n do // fill the matrix with random numbers from -10 to 10
for j: = 1 to n do
matr [i, j]: = random (21) -10;
for i: = 1 to n do // display the matrix on the screen
begin
for j: = 1 to n do
write (matr [i, j]: 5);
writeln;
end;
for i: = 1 to n do
for j: = 1 to n do
if matr [i, j]> 0 then s: = s + matr [i, j]; // check if the element of the matrix is positive, then add it to the sum
write (‘the sum of the positive elements of the matrix =’, s); // display the answer
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.