Given a two-dimensional array. Find the maximum element and check how many times it appears in each line.

program zz1;
const n = 4;
m = 7; // set the number of elements in the array
var i, j, max, k: integer; // set variables of integer type
b: 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
b [i, j]: = random (11);
for i: = 1 to n do // display the resulting array on the screen
begin
for j: = 1 to m do
write (b [i, j]: 4);
writeln;
end;
max: = 0;
for i: = 1 to n do
begin
for j: = 1 to m do
if b [i, j]> max then max: = b [i, j];
end;
writeln (‘max element =’, max); // display the answer
for i: = 1 to n do
begin
for j: = 1 to m do
if b [i, j] = max then k: = k + 1;
writeln (‘in’, i, ‘- th line the number of maximum elements =’, k); // display the answer
k: = 0;
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.