v,flag:int64;
c,i,len:longint;
begin
read(s);
val(s,v,c);
if (v=0) then write(0) else
if ((v<0) and (s[length(s)]='0')) then delete(s,length(s),1) else
if ((v>0) and (s[length(s)]='0')) then delete(s,length(s),1);
len:=length(s)+1;
repeat
if s[len]='0' then delete(s,len,1);
dec(len);
until s[len]<>'0';
if (v<0) then
begin
delete(s,1,1);
flag:=1;
end;
if flag=1 then write('-');
for i:=length(s) downto 1 do
write(s[i]);
end.
我是雷锋,不用谢!
评测ID: 743804
用户名: [email protected]
状态: 测试通过 Accepted
得分 : 100
总时间耗费: 10ms
总内存耗费: 256B
运行结果
测试点#1.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
测试点#2.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
测试点#3.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
测试点#4.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
测试点#5.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
测试点#6.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
测试点#7.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
测试点#8.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
测试点#9.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
测试点#10.in 结果:AC 内存使用量: 256kB 时间使用量: 1ms
var f:boolean;
n:string;
i:integer;
begin
readln(n);
f:=true;
if n[1]='-' then
begin
write('-');
for i:=length(n) downto 2 do
begin
if (n[i]<>'0') then f:=false;
if f=false then write(n[i]);
end;
end
else
for i:=length(n) downto 1 do
begin
if (n[i]<>'0') then f:=false;
if f=false then write(n[i]);
end;
if f=true then write('0');
readln;
readln;
end.