Var ar:array[1..n] of integer; i,indf:integer; begin indf:=-1; for i:=1 to n do begin readln(ar[i]); if not(odd(ar[i])) then indf:=i; end; if indf=-1 then writeln('Нет чётных') else begin for i:=indf to n-1 do ar[i]:=ar[i+1]; for i:=1 to n-1 do write(ar[i]:4); end; end.
Const
n=5;
Var
ar:array[1..n] of integer;
i,indf:integer;
begin
indf:=-1;
for i:=1 to n do
begin
readln(ar[i]);
if not(odd(ar[i])) then indf:=i;
end;
if indf=-1 then
writeln('Нет чётных')
else
begin
for i:=indf to n-1 do
ar[i]:=ar[i+1];
for i:=1 to n-1 do
write(ar[i]:4);
end;
end.
Пример ввода:
1 2 3 4 5
Пример вывода:
1 2 3 5