Write a program for solving the problem in Pascal. Consider the number of residents in the house as a random number from

Write a program for solving the problem in Pascal. Consider the number of residents in the house as a random number from 50 to 200 people, and the number of houses n = 30.

To perform this action, you need to form an array and sum it up.

Var
i: integer;
begin
randomize;
writeln (‘Number of tenants:’);
for i: = 1 to 30 do
writeln (‘House’, i, ‘-‘, random (151) +50);
end.

Or in another way:

s: = 0;
for i: = 1 to 30 do begin
a [i]: = randon (151) +50;
s: = s + a [i] end;
writeln (‘s =’, s);



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.