// // Created by Owner on 2015/08/01. // #include using namespace std; int cnt = 0; int que(int num){ cout << "? " << num << endl; int rtn; cin >> rtn; cnt++; return rtn; } int main() { int max_num, min_num; max_num = 1000000000; min_num = 10; int ans; while ((max_num - min_num) > 1) { if ((cnt % 10) == 0) { ans = que(10); if (ans != 1) { if (ans == -1) { while (true) { ans = que(0); if (ans == 0) { break; } } } min_num = 0; break; } } else { int num = (max_num + min_num - cnt * 2) / 2; ans = que(num); if (ans == 0) { min_num = num; break; } if (ans == 1) { min_num = num + 1; } else { max_num = num; } } } cout << "! " << min_num + cnt + 1 << endl; return 0; }