Const n=15;
var c:array[1..n] of integer;
k,i:integer;
begin
Randomize;
for i:=1 to n do begin
c[i]:=random(51);
write(c[i],' ');
end;
writeln;
k:=0;
for i:=1 to n do
if c[i] mod 2<>0 then k:=k+1;
writeln('k = ',k);
end.
Пример:
34 45 49 29 19 18 20 29 10 13 35 24 48 42 20
k = 7