inverse matrix by 51b

double x[9][18],t;i,j,k;main(){for(;~scanf("%lf",x[k/9]+k++%9);)x[k/9][k/9+9]=1;for(;j<18;j++)x[2][j]+=x[4][j];for(;i<9;i++){t=x[i][i];for(j=0;j<18;)x[i][j++]/=t;for(j=0;j<9;j++)for(t=x[j][i],k=0;i-j&&k<18;k++)x[j][k]-=t*x[i][k];}for(i=0;i<81;i++)printf("%.f%c",x[i/9][i%9+9]+.1,i%9-8?32:10);}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page