using System; public class Program { public static void Main() { int min = 0, max = (int)Math.Pow(10, 9); int mid; for (mid = (int)Math.Ceiling((min + max) / 2.0); 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); } }