#include <stdio.h>
int main() {
int State;
int top = 1000000000;
int bot = 1;
int ans;
while (1==1) {
ans = (top + bot) >> 1;
printf("%d\n", ans);
fflush(stdout);
scanf("%d", &State);
if (State == 0) {
break;
} else if (State == 1) {
top = ans;
} else if (State == -1){
bot = ans;
}
}
return 0;
}
本人过菜,前来询问