#include #include using namespace std; int main() { int ans = 0; int ret, tmp; for (int bit = 30; bit >= 0; bit--) { tmp = ans + (1 << bit); cout << "? " << tmp << endl; cin >> ret; if (ret == 1) { ans = tmp; } } cout << "! " << ans << endl; return 0; }