Description
给出一个数n,输出n二进制最低位的值
Input
多组输入,每组用例占一行包括一个整数n,以n=0结束输入
Output
输出lowbit(n)
Sample Input
26
88
0
Sample Output
2
8
Solution
水题,lowbit(n)=n&(-n)
Code
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
int n;
while(scanf("%d",&n),n)
printf("%d\n",n&(-n));
return 0;
}