Example #1
0
        public static void Select(Linear_Array arr)
        {
            int var = 0;

            Console.WriteLine("Переменная");
            var = Convert.ToInt32(Console.ReadLine());
            int key = 1;

            while (key != 0)
            {
                Console.WriteLine("Выберете необходимое дейсвие: \nНайти сумму - 1\nНайти разность - 2\nНайти произведение - 3\nДля выхода - 0");
                key = Convert.ToInt32(Console.ReadLine());
                switch (key)
                {
                case 1:
                    arr.Addition(var);
                    Console.WriteLine("СУММА = {0}", arr.Print());
                    break;

                case 2:
                    arr.Difference(var);
                    Console.WriteLine("РАЗНОСТЬ = {0}", arr.Print());
                    break;

                case 3:
                    arr.ProductOfNumbers(var);
                    Console.WriteLine("ПРОИЗВЕДЕНИЕ = {0}", arr.Print());
                    break;
                }
            }
        }
Example #2
0
 private void button4_Click(object sender, EventArgs e)
 {
     arr.Difference(var);
     label2.Text = "МАССИВ: " + arr.Print();
 }