Lowest bittime limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)
Total submission (s): 7728 accepted submission (s): 5674
Problem descriptiongiven an positive integer A (1 <= A <= 100), output the lowest Bit Of.
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 shocould 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 shocould be 8.
Inputeach 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.
Outputfor each A in the input, output a line containing only its lowest Bit.
Sample Input
26880
Sample output
28
This knowledge point is required for tree arrays.
#include <stdio.h>int main(){int n;while(scanf("%d", &n), n){printf("%d\n", n & (-n));}return 0;}