原题:
Lowest Bit
?1000ms??32768K
描述:
Given an positive integer A (1 <= A <= 100), output the lowest bit of A.
For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2.
Another example goes like this: given A = 88, we can write A in binary form as 1011000, so the lowest bit of A is 1000, so the output should be 8.
输入:
Each line of input contains only an integer A (1 <= A <= 100). A line containing "0" indicates the end of input, and this line is not a part of the input data.
输出:
For each A in the input, output a line containing only its lowest bit.
样例输入:
26
88
0
样例输出:
2
8
(链接:Lowest Bit | JXNUOJ)
翻译:
最低位
已知一个正整数A(1<=A<=100),输出A的最低位。
例如,整数A=26,我们可以写出A的二进制数11010,所有A的最低位是10,输出应该输出2.
另一个相似的例子是:A=88,我们可以写出A的二进制数1011000,所有A的最低位是1000,所有输出8。
输入:
每行包括一个整数A(1<=A<=100).某行输入为0则代表输入结束,并且0不作为输入数据。
输出:
对于每一个输入A,在一行输出其最低位。
|