Esempio n. 1
0
        private static void Task()
        {
            int[,] Arr2A, Arr2B;
            do
            {
                Arr2A = ToolsConsoleArr2.ReadArr2();
                if (Arr2A.GetLength(0) != Arr2A.GetLength(1))
                {
                    Console.WriteLine("не квадратный массив введите заново");
                }
            } while (Arr2A.GetLength(0) != Arr2A.GetLength(1));
            do
            {
                Arr2B = ToolsConsoleArr2.ReadArr2();
                if (Arr2B.GetLength(0) != Arr2B.GetLength(1))
                {
                    Console.WriteLine("не квадратный массив введите заново");
                }
            } while (Arr2B.GetLength(0) != Arr2B.GetLength(1));
            ToolsArr2 toolsArr2 = new ToolsArr2(Arr2A);
            int       A         = toolsArr2.GetDiagSum();

            toolsArr2 = new ToolsArr2(Arr2B);
            int B = toolsArr2.GetDiagSum();

            ToolsConsoleArr2.OutputStr(A + " " + B + " " + (A + B));
        }
Esempio n. 2
0
 static void Main(string[] args)
 {
     while (true)
     {
         try
         {
             List <Student> students = (List <Student>)StrToStudents(ToolsConsoleArr2.Read());
             students.Sort();
             List <Student> newStudents = new List <Student>();
             int            N           = 0;
             do
             {
                 Console.Write("введите количество мест");
             } while (!int.TryParse(Console.ReadLine(), out N));
             for (int i = 0; i < Math.Min(N, students.Count); i++)
             {
                 newStudents.Add(students[i]);
             }
             ToolsConsoleArr2.Output(StudentsToString(newStudents));
         }
         catch (Exception)
         {
             Console.WriteLine("ошибка ввода");
         }
     }
 }
Esempio n. 3
0
        private static void Task()
        {
            int[,] Arr2 = ToolsConsoleArr2.ReadArr2();
            ToolsArr2 toolsArr2 = new ToolsArr2(Arr2);

            bool[,] OutArr2 = toolsArr2.GetSaddlet();
            ToolsConsoleArr2.OutputArr2(OutArr2);
        }
Esempio n. 4
0
        private static void Task()
        {
            int[,] Arr2 = ToolsConsoleArr2.ReadArr2();
            ToolsArr2   toolsArr2 = new ToolsArr2(Arr2);
            List <Cell> list      = toolsArr2.GetCels();

            ToolsConsoleArr2.OutputStr(ConvertList.ListToStr(list));
        }
Esempio n. 5
0
 static void Main(string[] args)
 {
     while (true)
     {
         int[,] Arr2 = ToolsConsoleArr2.ReadArr2();
         ToolsArr2 toolsArr2 = new ToolsArr2(Arr2);
         if (toolsArr2.Check())
         {
             Console.WriteLine("удволетворяет условию");
         }
         else
         {
             Console.WriteLine("не удволетворяет условию");
         }
     }
 }
Esempio n. 6
0
 static void Main(string[] args)
 {
     while (true)
     {
         int[,] Arr2 = ToolsConsoleArr2.ReadArr2();
         if (Arr2.GetLength(0) != Arr2.GetLength(1))
         {
             Console.WriteLine("не квадратная матрица");
         }
         else
         {
             ToolsArr2   toolsArr2 = new ToolsArr2(Arr2);
             IList <Row> list      = toolsArr2.GetRowsSum();
             ToolsConsoleArr2.OutputStr(ConvertList.ListToStr(list, "\r\n"));
         }
     }
 }