模板题
public class Solution extends GuessGame {
public int guessNumber(int n) {
int l = 1, r = n;
while (l < r){
int mid = l + (r-l)/2;
int re = guess(mid);
if (re == 0) return mid;
else if (re == -1) r = mid;
else l = mid + 1;
}
return l;
}
}