solution for chapter5

bit manipulation