Advertisement
Denis1098

Untitled

Nov 14th, 2019
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1.         public int[,] ReadMatrix(string path)
  2.         {
  3.             try
  4.             {
  5.                 string[] mass = File.ReadAllLines(path);
  6.                 //string[,] arr = new string[mass.Length, mass[0].Split(' ').Length];
  7.                 int[,] fd = new int[mass.Length, mass[0].Split(' ').Length];
  8.                 for (int i = 0; i < mass.Length; i++)
  9.                 {
  10.                     string[] buf = mass[i].Split(' ');
  11.                     for (int j = 0; j < buf.Length; j++)
  12.                     {
  13.                         fd[i, j] = Convert.ToInt32(buf[j]);
  14.                     }
  15.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement