inverse matrix by 51b

import std.stdio;real[18][9]x;real[18]w;real t;int i,j;void main(){for(;i<81;scanf("%llf",&x[i/9][i%9]),i++)x[i/9][i%9+9]=i/9==i%9;for(i=0;i<9;i++){i-2||(w[]=x[i],x[i][]=x[4],x[4][]=w);t=x[i][i];foreach(inout y;x[i])y/=t;for(j=0;j<9;j++)if(t=x[j][i],i!=j)foreach(k,y;x[i])x[j][k]-=t*y;}for(i=0;i<81;i++)writef("%.f",x[i/9][i%9+9]+.1,i%9<8?" ":"
");}

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

download

return to the top page