спорт
++++++++++++++++++++++++++++++++
float slau(float **a2, int n, float *b2, float *x)
{int i,j,k,r;
float max,c,s,m;
float **a, *b;
b=new float[n];
a=new float *[n];
for(i=0;i
b[i]=b2[i];}
for(i=0;i
for(k=0;k
max=fabs(a[k][k]);
for(i=k+1;i
{max=fabs(a[i][k]);
r=i;}
for(j=0;j
a[k][j]=a[r][j];
a[r][j]=c;}
c=b[k];
b[k]=b[r];
b[r]=c;
for(i=k+1;i
b[i]-=m*b[k];}}
if(a[n-1][n-1]==0)
{if(b[n]==0)
return(-2);
else
return(-1);}
else
for(i=n-1;i>=0;i--)
{for(s=0,j=i+1;j
x[i]=(b[i]-s)/a[i][i];}
return(0);}