#include
The class deter
{
Int the order;
Double * * _deter;
Public:
Deter (int);
To deter () {delete [] _deter; }
Deter (deter&);
Void GetDeter ();
Void the Display ();
Friend void Calculate (deter);
};
Deter: : deter (int n) : the order (n)
{
_deter=new double * [order].
for(int i=0; i
}
Deter: : deter (deter & amp; X)
{
The order=x.o. rder;
_deter=new double * [x.o. rder];
for(int i=0; i
for(int i=0; i
for(int j=0; j
_deter [I] [j]=x. _deter [I] [j];
}
}
}
Void deter: : GetDeter ()
{
Cout<& lt;" Please enter the determinant "& lt;
for(int j=0; j
Cin> _deter [I] [j];
}
}
}
Void deter: : Display ()
{
for(int i=0; i
for(int j=0; j
Cout
Cout
}
Void Calculate (deter x)
{
Double d;
Double the result=1;
For (int p=1; p
If (x. _deter [p] [1] p==0)
continue;
The else
{
For (int m=p; m
D=- x. _deter [m] [1] p/x. _deter [p - 1] [1] p;
for(int n=0; N
X. _deter [m] [n] +=d * x. _deter [p - 1] [n].
}
}
}
}
for(int i=0; i
The result *=x. _deter [I] [I];
}
Cout<& lt;" The determinant result to "& lt;
Void main ()
{
int n;
Cout<& lt;" Please enter the determinant order "& lt;
Deter a (n);
Atul gawande etDeter ();
Cout<& lt;" Here is that you just input the determinant "& lt;
Calculate (a);
}
CodePudding user response:
please bosses under the kang