- 数字反转
- 2014-10-29 20:24:56 @
var
a:string;
b:array[1..255]of integer;
c,i,s:integer;
begin
readln(a);
if a[1]='-' then
begin
write('-');
c:=2;
end
else c:=1;
s:=length(a);
for i:=c to s do
b[i]:=ord(a[i])-48;
i:=s;
while b[i]=0 do
begin
s:=s-1;
i:=i-1;
end;
for i:=s downto c do write(b[i]);
end.
4 条评论
-
幻影F绝杀 LV 8 @ 2014-11-01 08:25:45
!!大神啊!!
-
2014-10-31 23:51:02@
短么?
-
2014-10-31 23:50:51@
var a,b:longint;
begin
read(a);
while (a<>0) and (a mod 10=0) do a:=a div 10;
while a<>0 do begin b:=b*10+(a mod 10);a:=a div 10;end;write(b);
end. -
2014-10-31 12:33:45@
hh
- 1