#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
int t,n;
while(scanf("%d",&n),n)
{
t=n&(-n);
printf("%d\n",t);
}
//system("pause");
return 0;
}
转载于:https://www.cnblogs.com/zhangshu/archive/2011/08/16/2141452.html