源代码:
var
s:string;
i,op,c,w,w2,d:integer;
begin
readln(s);
op:=0;
for i:=1 to length(s) do
begin
if s[i]='.' then begin op:=1; break; end;
if s[i]='/' then begin op:=2; break; end;
if s[i]='%' then begin op:=3; break; end;
end;
if op=0 then
begin
for i:=length(s) downto 1 do
if s[i]<>'0' then begin c:=i; break; end;
for i:=c downto 1 do write(s[i]);
halt;
end;
if op=1 then
begin
for i:=1 to length(s) do if s[i]='.' then begin c:=i; break; end;
for i:=c-1 downto 1 do
if s[i]<>'0' then begin d:=i; break; end;
for i:=d downto 1 do write(s[i]);
write('.');
for i:=c+1 to length(s) do if s[i]<>'0' then begin w:=i; break; end;
for i:=length(s) downto w do write(s[i]);
halt;
end;
if op=2 then
begin
for i:=1 to length(s) do if s[i]='/' then begin c:=i; break; end;
for i:=c-1 downto 1 do if s[i]<>'0' then begin w:=i; break; end;
for i:=w downto 1 do write(s[i]); write('/');
for i:=length(s) downto c+1 do if s[i]<>'0' then begin w:=i; break; end;
for i:=w downto c+1 do write(s[i]);
halt;
end;
if op=3 then
begin
for i:=length(s)-1 downto 1 do
if s[i]<>'0' then begin c:=i; break; end;
for i:=c downto 1 do write(s[i]);
write('%');
halt;
end;
end.