private static int[,] IntMatrixConsole() { while (true) { try { Console.WriteLine("введите матрицу"); StringBuilder sb = new StringBuilder(); string line = ""; do { line = Console.ReadLine(); sb.AppendLine(line); } while (line != ""); int[,] Matrix = MatrixConvert.StringToIntMatrix(sb.ToString()); if (Matrix.GetLength(0) != Matrix.GetLength(1)) { throw new Exception("матрица не квадратная"); } return(Matrix); } catch (Exception eror) { Console.WriteLine(eror.Message); } } }
private static bool[,] BoolMatrixConsole() { while (true) { try { Console.WriteLine("введите матрицу"); StringBuilder sb = new StringBuilder(); string line = ""; do { line = Console.ReadLine(); sb.AppendLine(line); } while (line != ""); bool[,] Matrix = MatrixConvert.StringToBoolMatrix(sb.ToString()); return(Matrix); } catch (Exception eror) { Console.WriteLine(eror.Message); } } }