Biểu diễn nhị phân

View as PDF

Submit solution

Points: 100.00 (partial)
Time limit: 1.0s
Memory limit: 1G
Input: stdin
Output: stdout

Author:
Problem type
Allowed languages
C, C++, GAS64, Pascal, Perl, PHP, Python, Sed, TCL, Text

Cho số n , in ra màn hình số số bit 1 trong biểu diễn nhị phân của số n.

Input:

1 dòng duy nhất chứa số n (n <= 109)

Output :

Số bit 1 trong biểu diễn nhị phân của n.

Example Input :
Copy
3
Example Output :
Copy
2

Giải thích :

3 có dạng nhị phân là 11 => Đáp án là 2


Comments

Please read the guidelines before commenting.