View Code of Problem 3700

#include<iostream>
using namespace std;
#include<cmath>
int main()
{
	int a,count;
	while(cin>>a&&a!=0)
	{
		count=0;
		while(a!=0)
		{
			if(a%2!=0)
			{
				break;
			}
			count++;
			a/=2;
		}
		cout<<pow(2,count)<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3700