#include int main(void) { int i, ask = (1 << 29), ans0, ans1 = -1, y; for(i = 0; i < 30; i++) { printf("? %d\n", 1); fflush(stdout); scanf("%d", &ans0); if(ans0 != 1) { y = 2 * i + (ans0 == 0); break; } printf("? %d\n", ask - (2 * i + 1) ); fflush(stdout); scanf("%d", &ans1); ask += ans1 * (1 << ((28 - i) < 0 ? 0 : 28 - i ) ); if(ans1 == 0 || i == 29) { y = ask; break; } } printf("! %d\n", y); fflush(stdout); return 0; }