for matrix GetLength min for matrix GetLength if mas min mas min if mi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
for (i = 0; i < matrix.GetLength(0); ++i)
{
min = i;
for (j = i + 1; j < matrix.GetLength(0); ++j)
{
if ( mas[min] > mas[j])
min = j;
}
if ( min != i)
{
for (k = 0; k < matrix.GetLength(1); k++)
{
mas[k] = matrix[i, k]; matrix[i, k] = matrix[j, k]; matrix[j, k] = mas[k];
}
}
}