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