for min matrix for if min matrix min matrix mas min for min for if mas

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
for (i = 0; i < 6; i++)
{
min = matrix[i, 0];
for (q = 0; q < 4; q++)
{
if (min > matrix[i, q])
min = matrix[i, q];
}
mas[i] = min;
}
for (i = 0; i < 5; ++i)
{
min = i;
for (j = i + 1; j < 6; ++j)
{
if ( mas[min] > mas[j])
min = j;
}
if ( min != i)
{
for (k = 0; k < 6; k++)
{
mas[k] = matrix[i, k]; matrix[i, k] = matrix[j, k]; matrix[j, k] = mas[k];
}
}
}