示例#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));
        }
示例#2
0
        private static void Task()
        {
            int[,] Arr2 = ToolsConsoleArr2.ReadArr2();
            ToolsArr2 toolsArr2 = new ToolsArr2(Arr2);

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

            ToolsConsoleArr2.OutputStr(ConvertList.ListToStr(list));
        }
示例#4
0
 private void SearchBtn_Click(object sender, EventArgs e)
 {
     try
     {
         int[,] Arr2 = DataGridViewUtils.GridToArray2 <int>(Input);
         ToolsArr2   toolsArr2 = new ToolsArr2(Arr2);
         List <Cell> list      = toolsArr2.GetCels();
         Output.Text  = ConvertList.ListToStr(list);
         save.Enabled = true;
     }
     catch (Exception)
     {
         MessageBox.Show("ошибка ввода", "ошибка");
     }
 }
示例#5
0
 private void ChangeBtn_Click(object sender, EventArgs e)
 {
     try
     {
         int[,] Arr2 = DataGridViewUtils.GridToArray2 <int>(Input);
         ToolsArr2 toolsArr2 = new ToolsArr2(Arr2);
         int[,] OutArr2 = toolsArr2.GetCount();
         DataGridViewUtils.Array2ToGrid(Output, OutArr2);
         save.Enabled = true;
     }
     catch (Exception)
     {
         MessageBox.Show("ошибка ввода", "ошибка");
     }
 }
示例#6
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("не удволетворяет условию");
         }
     }
 }
 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"));
         }
     }
 }
示例#8
0
 private void CheckBtn_Click(object sender, EventArgs e)
 {
     try
     {
         int[,] Arr2 = DataGridViewUtils.GridToArray2 <int>(Input);
         ToolsArr2 toolsArr2 = new ToolsArr2(Arr2);
         if (toolsArr2.Check())
         {
             Output.Text = "удволетворяет условию";
         }
         else
         {
             Output.Text = "не удволетворяет условию";
         }
     }
     catch (Exception)
     {
         MessageBox.Show("ошибка ввода", "ошибка");
     }
 }
示例#9
0
 private void SearchBtn_Click(object sender, EventArgs e)
 {
     try
     {
         int[,] Arr2A = DataGridViewUtils.GridToArray2 <int>(InputA);
         int[,] Arr2B = DataGridViewUtils.GridToArray2 <int>(InputB);
         ToolsArr2 toolsArr2 = new ToolsArr2(Arr2A);
         int       A         = toolsArr2.GetDiagSum();
         OutputA.Text = A.ToString();
         toolsArr2    = new ToolsArr2(Arr2B);
         int B = toolsArr2.GetDiagSum();
         OutputB.Text   = B.ToString();
         OutputSum.Text = (A + B).ToString();
         save.Enabled   = true;
     }
     catch (Exception)
     {
         MessageBox.Show("ошибка ввода", "ошибка");
     }
 }