View Code of Problem 3700

#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<stdio.h>
#include<string.h>
#include<cmath>
using namespace std;
int main()
{
   int num;
   while(scanf("%d",&num)!=EOF)
   {
       if(num==0)
        break;
       string str="";
       int flag=0;
       while(num)
       {
           if(num%2==0)
            {
                flag++;
                num=num/2;
            }
            else break;
       }
       int k=1;
       k=k<<flag;
        cout<<k<<endl;
   }
   return 0;
}

Double click to view unformatted code.


Back to problem 3700