using System; public class Program { public static void Main() { int min = 1, max = (int)Math.Pow(10, 9); int mid = (int)Math.Ceiling((min + max) / 2.0); for (; min != max; mid = (int)Math.Ceiling((min + max) / 2.0)) { Console.WriteLine("? {0}", mid); bool isLess = int.Parse(Console.ReadLine()) == 0; if (isLess) { max = mid - 1; } else { min = mid; } } Console.WriteLine("! {0}", mid); } }