#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <stack> #include <string> #include <vector> using namespace std; int main(void) { int n; int cnt; while(cin >> n && n != 0){ cnt = 0; while(n % 2 == 0) { cnt++; n /= 2; } cout << pow(2, cnt) << endl; } } |
Double click to view unformatted code.