View Code of Problem 3700

#include<stdio.h>
#include<string.h>
#include<math.h>
int main() {
	int n,count;

	while (scanf("%d",&n)!=EOF&&n!=0) {
		count = 0;
		while (n != 0) {
			
			if (n % 2 != 0) {
				printf("%.0lf\n", pow(2, count));
				break;
			}
			count++;
			n = n / 2;
		}
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3700