Binary Numbers
#描述#
Given a positive integer n, print out the positions of all 1’s in its binary representation. The position of the least significant bit is 0. For example, The positions of 1’s in the binary representation of 13 are 0,2,3. Your task is writing a program which for each data set:
Reads a positive integer n,
Computes the positions of 1’s in the binary representation of n,
and writes the result.
#格式#
##输入格式##
The first line of the input contains exactly one positive integer d equal to the number of data sets, 1<=d<=1000. The data sets follow.
Each data set consists of exactly one line containing exactly one integer n, 1<=n<=10^6.
##输出格式##
The output should consists of exactly d lines, one line for each data set. Line I, 1<=I<=d, should contain increasing sequence of integers seperated by single spaces –the positions of 1’s in the binary representation of the I-th input number.
#样例1#
##样例输入1##
1
13
##样例输出1##
0 2 3
#限制#
1000ms
32768KB
#提示#
#来源#