2017年10月05日普及组 负进制
程序:
var
n,t,f:longint;
zfc:string;
begin
assign(input,'negii.in');
reset(input);
assign(output,'negii.out');
rewrite(output);
readln(n);
if n=0 then writeln('0');
t:=n;
zfc:='';
while t<>0 do
begin
f:=t mod (-2);
if f=-1 then begin t:=t-1; f:=1; end;
t:=t div (-2);
zfc:=chr(f+48)+zfc;
end;
writeln(zfc);
close(input);
close(output);
end.