Skip to content

Latest commit

 

History

History

016-number-of-ones

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

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