放一下高斯消元模板啦啦啦..
for ( i = 1; i <= n; i ++ ){
for ( j = i; j <= n; j ++ ){
if ( _abs ( fc[j][i] ) > eps ){
for ( k = i; k <= n+1; k ++ ){
swap ( fc[j][k], fc[i][k] );
}
break;
}
}
for ( j = 1; j <= n; j ++ ){
if ( i != j && _abs (fc[j][i]) > eps ){
double tmp = fc[j][i]/fc[i][i];
for ( k = i; k <= n+1; k ++ ) fc[j][k] -= tmp*fc[i][k];
}
}
}
for ( i = 1; i <= n; i ++ ){
for ( j = 1; j <= n; j ++ ){
if ( _abs (fc[j][i]) > eps ) ans[i] = fc[j][n+1]/fc[j][i];
}
}