Skip to content

Files

Latest commit

9987a3c · Mar 6, 2018

History

History

016-number-of-ones

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 6, 2018
Mar 6, 2018
Mar 6, 2018
Mar 6, 2018

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