The matrix A (4, 3) is given. Calculate the number of positive, negative and zero elements of the matrix

The matrix A (4, 3) is given. Calculate the number of positive, negative and zero elements of the matrix (each of them is assumed to be present). Replace all negative elements of the matrix with positive ones with the same absolute value. Print the resulting matrix line by line.

program zz1;
const n = 4;
m = 3; // set the number of elements in the array
var i, j, k: integer; // set variables of integer type
a: array [1..n, 1..m] of integer;
begin
for i: = 1 to n do
for j: = 1 to m do // get numbers and write them into an array
a [i, j]: = random (101) -50;
for i: = 1 to n do // display the resulting array on the screen
begin
for j: = 1 to m do
write (a [i, j]: 4);
writeln;
end;
for i: = 1 to n do
for j: = 1 to m do
if a [i, j]> 0 then k: = k + 1; // check if the element is positive, then count it
writeln (‘the number of positive array elements =’, k); // display the answer
k: = 0;
for i: = 1 to n do
for j: = 1 to m do
if a [i, j] <0 then k: = k + 1; // check if the element is negative, then count it
writeln (‘number of negative array elements =’, k); // display the answer
k: = 0;
for i: = 1 to n do
for j: = 1 to m do
if a [i, j] = 0 then k: = k + 1; // check if the element is zero, then count it
writeln (‘the number of zero elements in the array =’, k); // display the answer
for i: = 1 to n do
for j: = 1 to m do
if a [i, j] <0 then a [i, j]: = abs (a [i, j]);
for i: = 1 to n do // display the resulting array on the screen
begin
for j: = 1 to m do
write (a [i, j]: 4);
writeln;
end;
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.