//milliard.cs using System; using System.Text; namespace DAV { class Program { static void Main(string[] args) { int h2 = 1000000000;//or 500 int h1 = 0; int t = 0; Random rand = new Random(); int c = rand.Next(h2); //computer int h = rand.Next(h2); //human or h2/2; dav: t++; Console.WriteLine(); Console.Write(t); Console.Write(" "); Console.Write(c); Console.Write(" "); Console.Write(h); Console.Write(" "); if(h < c) { Console.Write("MORE"); int a=h; h=(h+h2)/2; h1=a; goto dav; } else if(h > c) { Console.Write("less"); int a=h; h=(h1+h)/2; h2=a; goto dav; } Console.Write("win by "); Console.Write(t); Console.Write(" steps"); Console.ReadKey(); }}}