var
i,j,k,l,n,m,o,p:longint;
s,s1:string;
begin
readln(n);
str(n,s);
if s[1]='-' then
begin
for i:=length(s) downto 2 do
s1:=s1+s[i];
s1:='-'+s1;
for i:=2 to length(s1) do
if s1[i]<>'0' then break;
write('-');
for j:=i to length(s1)-1 do
write(s1[j]);
writeln(s1[length(s1)]);
end
else
begin
for i:=length(s) downto 1 do
s1:=s1+s[i];
for i:=1 to length(s1) do
if s1[i]<>'0' then break;
for j:=i to length(s1)-1 do
write(s1[j]);
writeln(s1[length(s1)]);
end;
end.
我的你可以参考一下
其实根本不不需要用到数组子界。。。这样好难查错的