const n=16;
var p:array[1..n] of integer;
i,k:integer;
begin
for i:=1 to n do
p[i]:=random(27)+16;
write(p[i],' ');
end;
writeln;
k:=0;
if p[i]<30 then k:=k+1;
writeln('k = ',k);
end.
Пример:
37 42 36 36 41 34 42 27 20 29 36 25 27 30 20 29
k = 7
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
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;
writeln('k = ',k);
end.
Пример:
37 42 36 36 41 34 42 27 20 29 36 25 27 30 20 29
k = 7