#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int a; while (cin >> a) { if (a == 0) break; int len = 0; while (a % 2 == 0) { len++; a /= 2; } cout << pow(2, len) << endl; } } |
Double click to view unformatted code.