Вот программа:
uses Crt;
const n=20;
type Vec=array [1..n] of integer;
var A: Vec;
i, Sum1, Sum2, Col1, Col2: integer;
begin
ClrScr;
Randomize;
Sum1:=0;
Sum2:=0;
Col1:=0;
Col2:=0;
WriteLn('Massiv A :');
for i:=1 to n do
begin
A[i]:=random(100);
Write(A[i]: 4);
if A[i]<50 then<br> begin
Sum1:=Sum1+A[i];
Col1:=Col1+1;
end else
begin
Sum2:=Sum2+A[i];
Col2:=Col2+1;
end;
end;
WriteLn;
WriteLn('Sred<50 :', Sum1/Col1:6:2) ;<br> WriteLn('Sred>=50 :', Sum2/Col2:6:2) ;
ReadLn;
end.