An array of 30 elements is given. Find the arithmetic mean of the array elements that are less than 15. (in Pascal)

program zz1;
var mas: array [1..30] of integer;
i, k, sum: integer;
begin
for i: = 1 to 30 do // get the original array at random from 1 to 20
mas [i]: = random (20) +1;
for i: = 1 to 30 do
write (mas [i]: 5); // display the resulting array on the screen
writeln; // move to another line for output
for i: = 1 to 30 do
if mas [i] <15 then begin sum: = sum + mas [i]; k: = k + 1; end; // check if the number from the array is less than 15, then add it to the sum and calculate it
write (‘arithmetic mean =’, sum / k) // print 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.