Given an array a (20), sort in descending order the elements on the even numbers.

program zz1;
const n = 20; // set the number of elements in the array
var i, j, k, v: integer; // set variables of integer type
m: array [1..n] of integer;
b: array [1..10] of integer;
begin
for i: = 1 to n do // get n random numbers and write them into an array
m [i]: = random (21);
for i: = 1 to n do // display the original 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 k: = k + 1; b [k]: = m [i]; end; // rewrite numbers on even numbers into a new array

for i: = 1 to k-1 do // sort
for j: = 1 to k-i do
if b [j] <b [j + 1] then begin
v: = b [j];
b [j]: = b [j + 1];
b [j + 1]: = v;
end;
k: = 0;
for i: = 1 to n do // rewrite the numbers back
if i mod 2 = 0 then begin k: = k + 1; m [i]: = b [k]; end;

for i: = 1 to n do // display the resulting array on the screen
write (m [i], ”);
writeln;
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.