const
n = 30;
var
a: array [1..n] of integer;
i, c, m: integer;
count: array [1..2] of byte;
sum: array [1..2] of integer;
begin
randomize;m := 0;c := 0;
for i := 1 to 2 do
begin
count[i] := 0;
sum[i] := 0;
end;
for i := 1 to n do
begin
a[i] := random(61) - 30;
write(a[i]:3);
if (a[i] >= -20) and (a[i]
begin
inc(count[1]);
sum[1] := sum[1] + a[i];
end;
if (a[i] < 100) and (a[i] > -100)
and (a[i] mod 100 = 11) then
begin
inc(count[2]);
sum[2] := sum[2] + a[i]
end;
end;
writeln;
for i := 1 to n do
if (a[i] > 0) and (a[i] mod (abs(a[2])) = 0) and (a[i] mod 10 = 5) then
begin
c := c + a[i];
inc(m);
end;
writeln('1 ', sum[1] / count[1]);
writeln('2 ', sum[2] / count[2]);
writeln('3 ', c / m);
if ((a[1] + a[2]) / 2) > ((a[n] + a[n - 1]) / 2) then
writeln('4 ', (a[1] + a[2]) / 2, ' > ', (a[n] + a[n - 1]) / 2)
else
if ((a[1] + a[2]) / 2) = ((a[n] + a[n - 1]) / 2) then
writeln('4 ', (a[1] + a[2]) / 2, ' = ', (a[n] + a[n - 1]) / 2)
else
writeln('4 ', (a[1] + a[2]) / 2, ' < ', (a[n] + a[n - 1]) / 2);
end.
В программе выполняются все пункты с листочка. Некоторые из пунктов сами себе противоречат, но условия в задаче избегают ошибок