#include using namespace std; int main(){ int head_num = 100000000; int tail_num = 0; for(int i=0; i<100; i++){ int num = (head_num + tail_num) / 2; cout << "? " << num << endl; int tmp; cin >> tmp; if(tmp == 1){ if(tail_num == num){ cout << num << endl; return 0; } tail_num = num; }else{ if(head_num == num){ cout << num << endl; return 0; } head_num = num; } } cout << head_num << endl; return 0; }