binary increment by Hendrik

try:
 while 1:
  r=list(raw_input())
  i=0;c=r[:]
  while c and c.pop()!='0':
   i+=1;r[-i]='0'
  if i<len(r):r[-i-1]='1'
  print ''.join(r)
except:0

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page