#include"stdio.h"
#include"conio.h"
intjs(s,n)
ints[][N],n;
{intz,j,k,r,total=0;
intb[N][N];
if(n>2){for(z=0;z
elseb[j][k]=s[j+1][k];
if(z%2==0)r=s[0][z]*js(b,n-1);
elser=(-1)*s[0][z]*js(b,n-1);
total=total+r;
}
}
elseif(n==2)total=s[0][0]*s[1][1]-s[0][1]*s[1][0];
returntotal;
}
voidn_1(s,b,n)
ints[][N],n;
floatb[][N];
{intz,j,k,l,m,g,a[N][N];
for(z=0;z
for(j=0;j
for(k=0;k
elsea[k][g]=s[k][g];
}
b[z][j]=js(a,n-1);
}
}
}
main()
{inta[N][N];
floatb[N][N];
intr,z,j;
floattemp;
//clrscr();
printf("Inputoriginaldata:\n");
for(z=0;z
printf("\nPressEntercontinue......");
getchar();
//gotoxy(1,1);
printf("Theoriginalmatrixis:\n");
for(z=0;z
printf("\n");
}
r=js(a,N);
printf("\nTheoriginalmatrixhanglieshiis:|A|==%d\n",r);
if(r==0)printf("Because|A|==0,theoriginalmatrixhavenonijuzhen!");
else
{n_1(a,b,N);
for(z=0;z
for(z=0;z
b[z][j]=b[j][z];
b[j][z]=temp;
}
printf("Because|A|!=0,theoriginalmatrixhavenijuzhen!\n");
printf("ThebansuijuzhenA*is:\n");
for(z=0;z
printf("\n");
}
for(z=0;z
printf("\nThenijuzhenis:(A*)/|A|(|A|=%d)\n",r);
for(z=0;z
printf("\n");
}
}
}