const n=16;
var p:array[1..n] of integer;
i,k:integer;
begin
for i:=1 to n do
begin
p[i]:=random(27)+16;
write(p[i],' ');
end;
writeln;
k:=0;
for i:=1 to n do
if p[i]<30 then k:=k+1;</p>
writeln('k = ',k);
end.
Пример:
37 42 36 36 41 34 42 27 20 29 36 25 27 30 20 29
k = 7