|
W ramach naszej witryny stosujemy pliki cookies w celu świadczenia Państwu usług na najwyższym poziomie, w tym w sposób dostosowany
do indywidualnych potrzeb. Korzystanie z witryny bez zmiany ustawień dotyczących cookies oznacza, że będą one zamieszczane w Państwa
urządzeniu końcowym. Możecie Państwo dokonać w każdym czasie zmiany ustawień dotyczących cookies w ustawieniach swojej przeglądarki.
|
|
|
|
|
SPOJ Problem Set (tutorial)
9500. Bit counts
Problem code: BITCNTR
|
You are a detective working with Scotland Yard on a high-profile bank robbery case. The robber has left some trails in the form of numbers, which you believe will give you important clues about the robbery. Since you are genius, you know that the clues can obtained by converting the number in binary and counting the number of 1's.
Input
The first line has a number t followed by t lines. Each line contains a number < 512.
Output
Output t lines corresponding to each number, such that each of the line contains the clue obtained from the number.
Example
Input:
5 2 3 1 0 11
Output:
1 2 1 0 3
|
|
|
|