int[,] A = new int[n, n];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
A[i, j] = Convert.ToInt32(dataGridView1.Rows[i].Cells[j].Value);
}
int min = A[0, 0], min_j = -1;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
if (min < A[i, j])
{
min = A[i, j];
min_j = j;
}
}
if (min_j != 0) ;
{
int rez;
for (int i = 0; i < n; i++)
{
rez = A[i, 0];
A[i, 0] = A[i, min_j];
A[i, min_j] = rez;
label1.Text = Convert.ToString(min);
}
}
rez = A[i, min_j];
A[i, min_j] = A[i, 0];
A[i, 0] = rez;
if (min < A[i, j])
int min = A[0, 0], min_j = -1;
...
if (min_j != 0) ;
if (min_j > 0)
<code lang="cs">
if (min_j > 0)
{
int rez;
for (int i = 0; i > -1; i--)
{
for (int j = min_j; j > -1; j--)
{
rez = A[i, j];
A[i, j] = A[i, j + 1];
A[i, j + 1] = rez;
}
}
}
</code>