Guest User

Untitled

a guest
Mar 29th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #python
  2.  
  3. import sys
  4. import os
  5.  
  6. #this function is what need modified
  7. def CountBits( n):
  8.  
  9. #count = 0;
  10. #while(n):
  11. #n &= n - 1
  12. #count += 1
  13. #return(count)
  14.  
  15. f = open(os.environ['OUTPUT_PATH'], 'w')
  16. num = int(raw_input());
  17. binary = CountBits(num);
  18. for dis_bin in binary:
  19. f.write( str(dis_bin) + "n" )
  20. f.close()
Advertisement
Add Comment
Please, Sign In to add comment