- 数字反转
- 11 年前 @
RT
2 条评论
-
幻影F绝杀 LV 8 @ 10 年前
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. -
11 年前@
把字符数组去掉了一位
于是...AC了...
- 1