static void Main() { // This is CountDown in the Counter namespace. Counter.CountDown cd1 = new Counter.CountDown(10); // This is CountDown in the Counter2 namespace. Counter2.CountDown cd2 = new Counter2.CountDown(); int i; do { i = cd1.Count(); Console.Write(i + " "); } while (i > 0); Console.WriteLine(); cd2.Count(); }
static void Main() { // Это класс CountDown из пространства имен Counter. Counter.CountDown cd1 = new Counter.CountDown(10); Counter2.CountDown cd2 = new Counter2.CountDown(); int i; do { i = cd1.Count(); Console.Write(i + " "); } while (i > 0); Console.WriteLine(); cd2.Count(); }
static void Main() { Counter.CountDown cd1 = new Counter.CountDown(10); Counter2.CountDown cd = new Counter2.CountDown(); MyCounter cd4 = new MyCounter(); int i; do { i = cd1.Count(); Console.Write(i + " "); } while (i > 0); Console.WriteLine(); Counter.CountDown cd2 = new Counter.CountDown(20); do { i = cd2.Count(); Console.Write(i + " "); } while (i > 0); Console.WriteLine(); cd2.Reset(4); do { i = cd2.Count(); Console.Write(i + " "); } while (i > 0); Console.WriteLine(); cd.Count(); Console.ReadKey(); }