0

C# fill in matrix of a linear sequence from the lower left corner diagonally according to the patern

You need to fill in the matrix n*n, the side of which is chosen by the user, for example: 6 8 9 3 5 7 1 2 4

28th Feb 2021, 7:43 AM
Serhii77
Serhii77 - avatar
10 Respostas
+ 2
Can you show us your code or attempt please!
28th Feb 2021, 8:00 AM
Abhay
Abhay - avatar
+ 2
Serhii77 is this a question or a challenge ? Your code works fine !! What is the problem with it ?
28th Feb 2021, 8:36 AM
Abhay
Abhay - avatar
+ 2
This code outputs: 1 3 6 2 5 8 4 7 9 , And I need: 6 8 9 3 5 7 1 2 4
28th Feb 2021, 8:38 AM
Serhii77
Serhii77 - avatar
+ 1
https://code.sololearn.com/cDARzFga525K/?ref=app This code outputs: 1 3 6 2 5 8 4 7 9
28th Feb 2021, 8:19 AM
Serhii77
Serhii77 - avatar
0
I understand that the point is in the indices. But I can't change them correctly. help me please
28th Feb 2021, 9:11 AM
Serhii77
Serhii77 - avatar
0
Count down from n-1 to 0 instead of up and flip row and column indices
28th Feb 2021, 9:28 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
0
can you please fix in the code?
28th Feb 2021, 9:30 AM
Serhii77
Serhii77 - avatar
0
I already pointed out what to do, but i won't spoonfeed you. As I said, if you wrote that code yourself, you should be able to change it accordingly
28th Feb 2021, 9:37 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
0
I understand that n should decrease and j should decrease. But what is the first value of j?
28th Feb 2021, 10:02 AM
Serhii77
Serhii77 - avatar
- 1
Serhii77 that's just a matter of indices. If you wrote that code it should be easy for you to reverse the row index either when filling the matrix or at output
28th Feb 2021, 9:09 AM
Benjamin Jürgens
Benjamin Jürgens - avatar