View Code of Problem 3700

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
	int n;
	while (scanf("%d", &n) != EOF)
	{
		int sum=0;
		if (n == 0)
			break;
		while (n % 2 != 1)
		{
			sum++;
			n = n / 2;
		}
		int res = pow(2, sum);
		printf("%d\n",res);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3700