Answer the question
In order to leave comments, you need to log in
Why is the matrix not transposed?
public static int[,] getTransposeMatrix(int[,] matrix)
{
int[,] resMatrix = matrix;
for (int i = 0; i < resMatrix.GetLength(0); i++)
{
for (int j = 0; j < resMatrix.GetLength(1); j++)
{
int tmp = resMatrix[i, j];
resMatrix[i, j] = resMatrix[j, i];
resMatrix[j, i] = tmp;
}
}
return resMatrix;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question