View Code of Problem 3700

#include <stdio.h>
#include <math.h>
#include <string.h>

int main(){
    int a;
    while(scanf("%d",&a)&&a!=0){
        int num[1000],k=0,i;
        while(a!=0){
            num[k++]=a%2;
            a/=2;
        }
        for(i=0;num[i]!=1;i++);
        printf("%d\n",(int)pow(2,i));
    }
	return 0;
}

Double click to view unformatted code.


Back to problem 3700