#include <iostream> #include <algorithm> #include <cmath> using namespace std; int main() { int x, y; while (cin >> x >> y) { if (x < y)swap(x, y); while (x > y) { x /= 2; // cout<<x<<endl<<endl; } // if(y>x*2)y/=2; while (1) { if (x == y)break; while (x > y)x /= 2; while (x < y)y /= 2; } cout << x << endl; } } // 64 位输出请用 printf("%lld")