#include #include using namespace std; const int INF = 1e+9; int main() { int lb = 0, ub = INF, res; while(ub - lb > 1){ int mid = (lb + ub) / 2; printf("? %d\n", mid); fflush(stdin); scanf("%d", &res); if(res){ lb = mid; } else{ ub = mid; } } printf("! %d\n", ub); fflush(stdin); return 0; }