编写函数,将行参n所指变量中,各位上的偶数去除,剩余的按原顺序输出。不用求余方法做,换一种比如数组?

2025-02-22 16:21:29
推荐回答(2个)
回答1:

procedure abc(n:longint);
var s:string; i:integer;
begin
str(n,s);
for i:=length(s) downto 1 do
if odd(ord(s[i])) then write(s[i]);
end;
writeln;
end;

回答2:

http://codepad.org/RArFqKml