Реферат: Метод Гаусса с выбором главной переменной
if (J != (num+1-sr))
{
for (i = 1; i<=num; i++) {
A[i][J] = A[i][J] + A[i][num+1-sr];
A[i][num+1-sr] = A[i][J] - A[i][num+1-sr];
A[i][J] = A[i][J] - A[i][num+1-sr];
}
c[J] = c[J] + c[num+1-sr];
c[num+1-sr] = c[J] - c[num+1-sr];
c[J] = c[J] - c[num+1-sr];
}
if (I != (num+2-st))
{
for (j = 1; j<=num+1; j++) {
A[I][j] = A[I][j] + A[num+2-st][j];
A[num+2-st][j] = A[I][j] - A[num+2-st][j];
A[I][j] = A[I][j] - A[num+2-st][j]; }
}
}
// ------------------------------------------------------------------
void otvet()
{
float temp;
for (i=num; i>=1; i--)
{
temp = A[i][num+1];
for(j = num; j > i; j--) temp = temp - A[i][j]*x[j];
x[i] = temp/A[i][i];
}