Introduced:
First enter n, then enter n * n matrix, and finally output the value of the matrix.
#include <bits/stdc++.h> using namespace std;
float result;
int a[1010][1010];
float aa[1010][1010];
int n;
void Swap (float *a, float *b) {for (int i = 1; I <= n; ++i) {Float temp = a[i];
A[i] = B[i];
B[i] = temp;
} void GetValue () {float mul;
int iter = 0;
result = 1.0;
for (int i = 1; I <= n; ++i) {if (aa[i][i] = 0) {for (int k = i + 1; k <= N; ++k)
{if (Aa[k][i]!= 0) {Swap (Aa[i], aa[k]);
iter++;
Break
for (int k = i + 1; k <= N; ++k) {if (Aa[k][i]!= 0) {
Mul =-1 * (Aa[k][i]/aa[i][i]);
Aa[k][i] = 0;
for (int p = i + 1; p <= N; ++p) {aa[k][p] + = Mul * Aa[i][p];
}
}
}for (int i = 1; I <= n; ++i) result *= Aa[i][i];
if (iter% 2 = 1) result =-result;
} void Input () {scanf ("%d", &n);
for (int i = 1; I <= n; ++i) for (int j = 1; j <= N; ++j) {scanf ("%d", &a[i][j]);
AA[I][J] = A[i][j]; } void Putout () {for (int i = 1; I <= N. ++i) {for (int j = 1; j <= N; ++j) cout <& Lt
AA[I][J] << "";
cout << Endl;
int main () {Input ();
GetValue ();
Putout ();
cout << result << Endl;
}