Beispiel #1
0
        static void Main(string[] args)
        {
            Printer elem = new Printer("чёрный", 1233, "Belarus", "integral");

            Console.WriteLine(elem.ToString());
            Computer elem2 = new Computer("красный", 1543, "Belarus", "integral");
            Planshet elem3 = new Planshet("Синий", 1343, "Belarus", "integral");

            //структура
            Tovar.User Src;
            Src.age  = 2;
            Src.name = "Vadim";
            Src.DisplayInfo();
            //перечисление
            Tovar.Days days;
            days = Tovar.Days.Monday;
            Console.WriteLine("Понедельник: " + days);
            Console.WriteLine("Понедельник: " + (int)days);
            Set <Tovar> qw = new Set <Tovar>();

            qw.Set_Item(elem2);
            qw.Set_Item(elem);
            qw.Set_Item(elem3);
            qw.PrintAll();
            qw.RRR();
            qw.PrintAll();
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            var f    = new F();
            var g    = new G();
            var domi = new List <string>()
            {
                "W1", "W2", "W3", "W4"
            };
            var codomfi = new List <string>()
            {
                "X1", "X2", "X3"
            };
            var codomgi = new List <string>()
            {
                "Y1", "Y2"
            };

            new PushOut().getPushout(f, codomfi, g, codomgi, domi);

            var sr = new Src();
            var tg = new Tgt();
            var A  = new List <string>()
            {
                "f", "g", "h", "i", "j", "k"
            };
            var V = new List <string>()
            {
                "v", "w", "x", "y", "z"
            };

            V.Pushout(A, sr, tg).ForEach(Console.WriteLine);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            try
            {
                Printer elem = new Printer("зелёный", 1233, "Belarus", "integral");
                Console.WriteLine(elem.ToString());
                Computer elem2 = new Computer("красный", 1543, "Belarus", "integral");
                Planshet elem3 = new Planshet("синий", 1343, "Belarus", "integral");
                //структура
                Tovar.User Src;
                Src.age  = 2;
                Src.name = "Vadim";
                Src.DisplayInfo();
                //перечисление
                Tovar.Days days;
                days = Tovar.Days.Monday;
                Console.WriteLine("Понедельник: " + days);
                Console.WriteLine("Понедельник: " + (int)days);
                Set <Tovar> qw = new Set <Tovar>();
                qw.Set_Item(elem2);
                qw.Set_Item(elem);
                qw.Set_Item(elem3);
                qw.PrintAll();
                qw.RRR();
                qw.PrintAll();
                ///////1///////
                //int g = 5;
                //int t = g / 0;
                ///////////////

                ///////2///////
                //int[] mass = { 2, 4, 5 };
                //int y = mass[3];
                ///////////////

                ///////3///////
                //Planshet elem4 = new Planshet("зелёный", 1343, "Belarus", "integral");
                ///////////////

                ///////4///////
                //Planshet elem5 = new Planshet("белый", 1113, "Belarus", "integral");
                ///////////////

                //int[] aa = null;
                //Debug.Assert(aa != null, "values array cannot be null");
            }
            catch (DivideByZeroException)
            {
                Console.WriteLine("Возникло исключение DivideByZeroException");
                //throw;
            }
            catch (IndexOutOfRangeException)
            {
                Console.WriteLine("Возникло исключение IndexOutOfRangeException");
            }
            catch (ColorException ex)
            {
                Console.WriteLine($"Ошибка: {ex.Message}");
            }
            catch (IdException ex)
            {
                Console.WriteLine($"Ошибка: {ex.Message}");
            }
            finally
            {
                Console.WriteLine("Блок finally");
                Console.ReadLine();
            }
        }