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;
}