uses crt;
var st,st1,st2:string;
a:array[1..255]of integer;
n,d,i,dem,x,kt:integer;
begin
clrscr;
write('nhap so n:'); readln(n);
str(n,st);
d:=length(st);
for i:=1 to d do
val(st[i],a[i],x);
st2:='';
dem:=0;
kt:=0;
for i:=1 to d do
if a[i] mod 2<>0 then
begin
kt:=1;
dem:=dem+1;
str(a[i],st1);
st2:=st2+st1;
end;
if kt>0 then
begin
write('doi xung cua phan con lai sau khi xoa bot cac so chan la: ');
for i:=1 to dem do
write(st2[i]);
for i:=dem downto 1 do
write(st2[i]);
end;
readln;
end.
uses crt;
var a:array[1..255]of byte;
n,i,kt:integer;
st,st1:string;
begin
clrscr;
write('nhap chieu dai day so:'); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
{-------------------------------xu-ly---------------------------------}
st:='';
kt:=0;
for i:=1 to n do
if a[i] mod 2=1 then
begin
str(a[i],st1);
kt:=1;
st:=st+st1;
end;
if kt>0 then
begin
write('doi xung cua cac so le la: ');
for i:=1 to length(st) do
write(st[i]:4);
for i:=length(st) downto 1 do
write(st[i]:4);
end;
readln;
end.