var
a: array[1..100] of integer;
n, i, cnt1, cnt2: integer;
ans1, ans2: real;
begin
n := random(100) + 1;
for i := 1 to n do
a[i] := random(101);
writeln(a[i]);
end;
if (a[i] < 50) then
cnt1 := cnt1 + 1;
ans1 := ans1 + a[i];
end
else
cnt2 := cnt2 + 1;
ans2 := ans2 + a[i];
writeln(ans1 / cnt1, ' ', ans2 / cnt2);
end.
Файл решения прикреплён.
var
a: array[1..100] of integer;
n, i, cnt1, cnt2: integer;
ans1, ans2: real;
begin
n := random(100) + 1;
for i := 1 to n do
begin
a[i] := random(101);
writeln(a[i]);
end;
for i := 1 to n do
if (a[i] < 50) then
begin
cnt1 := cnt1 + 1;
ans1 := ans1 + a[i];
end
else
begin
cnt2 := cnt2 + 1;
ans2 := ans2 + a[i];
end;
writeln(ans1 / cnt1, ' ', ans2 / cnt2);
end.
Файл решения прикреплён.