#include <iostream> #include <cmath> using namespace std; int main() { int a; while(cin >>a&&a){ int n=0; while(a%2==0){ a=a/2; n++; } cout <<pow(2,n)<<endl; } return 0; }
Double click to view unformatted code.