It is necessary to read the string value from the RichTextBox into an array. enter image description here

It is necessary to add these lines (something like the adjacency matrix) to the array:

 int GM[n][n] = { {0, 1, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 1}, {0, 0, 1, 0}, }; 
  • Try to write more detailed questions. Explain exactly what you see the problem, how to reproduce it, what you want to get as a result, etc. - Nicolas Chabanovsky

1 answer 1

  1. We read lines from the RichTextBox using the Lines property;
  2. String::Split each string into substrings comma separated by String::Split ;
  3. We translate each substring into a number, for example through StringToInt32 ;
  4. Write the numbers in an array in accordance with the indices.