1454 Binary Numbers
Submit solution
Points:
100
Time limit:
1.0s
Memory limit:
32M
Problem types
Allowed languages
C, C++, Java, Python
Description
Given a positive integer n,print the positions of all 1’s in its binary representation.
Example
The positions of 1’s in the binary representation of 13 are 0,2,3.
Input
The input consists of multiple test cases.Every test case contain a integer n(0<n<=10^9).
Output
For every input,you should output a line.The line should contain increasing sequence of integers separated by single spaces—the positions of 1’s in the binary representation of the input number.
Sample
Input
13
5
Output
0 2 3
0 2
Comments