Find the lowest bit
Time Limit : 1 Second
Memory Limit : 128 MB
Submission: 167
Solved: 52
- Description
- Any decimal number can write in the binary format.For example the binary format of decimal number 26 is 11010.
Now please find the lowest bit of a decimal number, output it in the decimal format.
The lowbit of a number is from right to left, find the first '1',then 1 with the follow 0 is the lowbit.
For example A=26, the binary format is 11010 then 10 is lowbit, but we should output it with 2(decimal format)
An other example is A=120, the binary format is 1111000, so it's lowbit is 1000, then we output 8. - Input
- The first line has a number T, means T cases.(T <= 1000)
each case input a number N in a line.(0 <= N < 1000) - Output
- For each case, output a line, the lowbit of a number N.
- sample input
-
2 26 120
- sample output
-
2 8
- hint
- source
- Zehua Hong