Given a sequence of n real numbers, find the difference between max and min (Pascal ABC).

program zz1;
const n = 4; // set the number of elements in the sequence
var max, min: real; // set variables of integer type
i: integer;
m: array [1..n] of real;
begin
for i: = 1 to n do // organize a loop in which we enter n given numbers from the keyboard into the sequence
read (m [i]);
min: = 1,000,000; // set the initial value for the minimum and maximum elements of the sequence
max: = 0;
for i: = 1 to n do
begin
if m [i]> max then max: = m [i];
if m [i] <min then min: = m [i];
end;
writeln (‘difference between maximum and minimum elements =’, max-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.