An array is given that contains N elements and is filled with random numbers from -10 to 9.

An array is given that contains N elements and is filled with random numbers from -10 to 9. Form a new array from the values of the elements in even places. Count the number of negative and positive element values in the new array.

program zz1;
const n = 15; // set the number of elements in the array
var i, s, k1, k2: integer; // set variables of integer type
m, v: array [1..n] of integer;
begin
for i: = 1 to n do // get n random numbers and write them into an array
m [i]: = random (20) -10;
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
for i: = 1 to n do
if i mod 2 = 0 then begin s: = s + 1; v [s]: = v [s] + m [i]; end; // form a new array
for i: = 1 to s do // display the resulting array on the screen
write (v [i], ”);
writeln;
for i: = 1 to s do
if v [i]> 0 then k1: = k1 + 1;
writeln (‘number of positive elements =’, k1); // display the answer
for i: = 1 to s do
if v [i] <0 then k2: = k2 + 1;
writeln (‘number of negative elements =’, k2); // 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.