麪試系列8
原題:
Write the function int bitCount(short input) that takes a short as input and
returns an int. The function returns the number of bits set in the input
variable. For instance:
bitCount(7) -->3
bitCount(2543) -->9
bitCount(11111) -->9
0條評論