Пример #1
0
        static void Main(string[] args)
        {
            ENGreeter eng = new ENGreeter();
            FRGreeter frg = new FRGreeter();
            RUGreeter rug = new RUGreeter();
            Greeter_Adapter ga = new Greeter_Adapter();

            eng.SayHello();
            frg.SayHello();
            rug.SayHello();
            ga.SayHello();

            Console.ReadKey();

            Console.WriteLine("Класс NumPrint");
            Console.Write("Введите n: ");
            int n = Convert.ToInt32(Console.ReadLine());
            NumPrinter numpr = new NumPrinter(n);
            int[] MassNum = numpr.GetNumbers();
            for (int i = 0;i<MassNum.Length;i++)
            {
                Console.Write(MassNum[i] + "  ");
            }
            Console.ReadKey();

            Console.WriteLine("Класс ProxyNumPrint");
            Console.Write("Введите n: ");
            int Pn = Convert.ToInt32(Console.ReadLine());
            Proxy_numprint Proxynumpr = new Proxy_numprint(Pn);
            int[] ProxyMassNum = Proxynumpr.GetNumbers();
            for (int i = 0; i < MassNum.Length; i++)
            {
                Console.Write(MassNum[i] + "  ");
            }
            Console.ReadKey();
        }
Пример #2
0
 public Proxy_numprint(int Pn)
 {
     this.Pn = Pn;
     Nump = new NumPrinter(Pn);
     Proxy_Numbers = Nump.GetNumbers();
 }