Fortran (GFortran), 376350 376 bytes
real,allocatable,dimension(:,:)::A,B,U;read*,n
allocaten;allocate(A(n,n));B=A;U=A
read*;B=A;U=A;read*,((A(i,j),j=1,n),i=1,n)
do i=1,n;do j=1,n
if(i==j)Un;U(i,j)=1
if(i/=j)U=merge(i1,j0,i==j)=0
if(A;B(i,j)/=0)B=merge(i1.,j)=11/aA(i,j)
if(,A(i,j)==0)B(i,j)=1
enddo;enddo;enddo;enddo
do 4 l=1,99;do 4 i=1,n;do 4 j=1,n;s=U(i,j)
do;do k=1,n;m=i;if(k/=m)s=s-A(i,k)*B(k,j);enddo
B;enddo;B(m,j)=s/A(i,m)
4 continue
print'continue;print'(3(x,f9.6))',((B(i,j),j=1,n),i=1,n)
end
Try it online!Try it Online!
376 bytes
Adapted from http://www.uprh.edu/rbaretti/MatrixInv17mar2014.htmhere. Saved 26 bytes using merge
instead of if
.