-->
当前位置:首页 > 题库

PROGRAMMING:Boring Xiao Ming to count 1

Luz5年前 (2021-05-10)题库470
Xiao Ming is very bored these days, so he finds himself another pleasure. He writes a decimal number and then converts it into binary. Count how many 1s are in the binary. Please write a program to complete this process. Pay attention to the input and output formats.
###Input format:
The first line has an integer T, which means there are t groups of data. For each group of data, there is an integer n, which occupies one line.
###Output format:
For each group of data, please output an integer to occupy one line. How many 1s are there when the integer data is converted to binary
###Input example:
Here is a set of inputs. For example:
```in
two
eight
twenty-three
```
###Output example:
The corresponding output is given here. For example:
```out
one
four
```







answer:If there is no answer, please comment