For an array K of 12 real numbers, determine the number of neighborhoods from two positive numbers …

program zz1;
const k = 12; // set the number of elements in the array
var i, p: integer; // set variables of integer type
a: array [1..k] of integer;
begin
for i: = 1 to k do // write numbers in the array at random
a [i]: = random (101) -50;
for i: = 1 to k do // display the array on the screen
write (a [i], ”);
writeln; // go to a new line to display the response
for i: = 1 to k-1 do
if (a [i]> 0) and (a [i + 1]> 0) then p: = p + 1;
write (‘the number of positive adjacent elements in the array’, p);
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.