Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 560 Bytes

File metadata and controls

31 lines (25 loc) · 560 Bytes

Number of Ones

Challenge Description:

Write a program which determines the number of 1 bits in the internal representation of a given integer.

Input sample:

The first argument is a path to a file. The file contains integers, one per line.

For example:

10
22
56

Output sample:

Print to stdout the number of ones in the binary form of each number.

For example:

2
3
3