改變N的值可以求N階行列式的值
#define N
#include <stdio
#include <stdlib
void main()
{
int i
double a[N][N]
for (i=
for (j=
scanf (
for (i=
{
if (a[i][j]==
{
for (m=i;a[m][j]==
if (m==N)
{
sn=
printf(
exit(
}
else
for (n=j;n<N;n++)
{
c=a[i][n];
a[i][n]=a[m][n];
a[m][n]=c;
}
k*=(
}
for (s=N
{
x=a[s][j];
for (t=j;t<N;t++)
a[s][t]
}
}
for (i=
f*=a[i][i];
sn=k*f;
printf (
}
<
From:http://tw.wingwit.com/Article/program/c/201311/11105.html