An array of size N is given. Find the minimum of its local maxima (a local maximum is an element

An array of size N is given. Find the minimum of its local maxima (a local maximum is an element that is larger than any of its neighbors).

program zz1;
const n = 14; // set the number of elements in the array
var i, min: integer; // set variables of integer type
m: array [1..n] of integer;
begin
for i: = 1 to n do // write numbers in the array at random
m [i]: = random (201) -60;
for i: = 1 to n do // display the array on the screen
write (m [i], ”);
writeln; // go to a new line to display the response
min: = 1,000,000; // set the initial value for the minimum element
for i: = 2 to n-1 do // organize a loop in which we iterate over all the numbers in the array
if (m [i]> m [i + 1]) and (m [i]> m [i – 1]) then if m [i] <min then min: = m [i];
write (‘minimum local maximum =’, min); // 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.