var ar:array[1..n] of integer; ar2:array[1..n] of integer; i,k:integer; begin; for i:=1 to 5 do begin; readln(ar[i]); if odd(ar[i]) then begin; inc(k); ar2[k]:=ar[i]; end; end; if k=0 then begin; writeln('No odd numbers'); exit; end; writeln('Result:'); for i:=1 to k do write(ar2[i]:4); end.
Answers & Comments
Verified answer
//Pascal ABC.NET Версия 2.2 Сборка 790Const
n=5;
var ar:array[1..n] of integer;
ar2:array[1..n] of integer;
i,k:integer;
begin;
for i:=1 to 5 do
begin;
readln(ar[i]);
if odd(ar[i]) then
begin;
inc(k);
ar2[k]:=ar[i];
end;
end;
if k=0 then
begin;
writeln('No odd numbers');
exit;
end;
writeln('Result:');
for i:=1 to k do write(ar2[i]:4);
end.