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