View Code of Problem 3700

#include<iostream>
#include<cstdio>

using namespace std;

int main()
{
	int a;
	while(scanf("%d", &a) != EOF)
	{
		int n = 1;
		if(a == 0)
			break;
		while(a != 0)
			if(a % 2 == 0)
			{
				n *= 2;
				a /= 2;
			}
			else
				break;
		cout << n << endl;
	}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 3700