Var a:array[1..30] of integer;
i, n, k:integer;
fout:text;
begin
for i:=1 to 30 do
a[i]:=30 - random(51);
assign(fout, 'out.txt');
rewrite(fout);
for i:=1 to 30 do
if a[i] mod 2 <> 0 then
k:=k+1;
if k <> 0 then
for i:=1 to 30 do begin
if a[i] mod 2 <> 0 then
write(fout, a[i], ',');
end
else write(fout, 'Нечетных элементов массиве нет.');
close(fout);
end.