View Code of Problem 3700

#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
	int a,i,k;
	while( cin>>a )
	{
		if( a==0 )break;
		k=0;
		while( a!=0 )
		{
			if( a%2 == 1 )
			break;
			else k++;
			a/=2;
		}
		cout<<pow(2,k)<<endl;
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 3700