Solving a quadruple equation

xiaoxiao2021-03-06  15

// This program is based on the .NET platform, the compilation environment is Microsoft Visual C .NET

// For the modification of the VC 6.0 platform, only stdafx.h will be replaced with iostream.h, then remove "Using Namespace STD" in the code

#include "stdafx.h"

#include "math.h"

Using namespace std;

Double du, DV;

Void Solu_w (Double A, Double B, Double C)

{

Double Tem, Tem1;

Tem1 = b * b-4 * a * c;

Double M, N;

M = (- 1) * b / (2 * a);

IF (Tem1> = 0)

{

TEM = SQRT (TEM1);

N = TEM / (2 * a);

COUT << "/ n Equation root is:" << '/ n' << "/ t x1 =" << m n << '/ n' << "/ t x2 =" << MN << endl ;

}

Else

{

TEM = SQRT ((- 1) * TEM1);

N = TEM / (2 * a);

Cout << "/ n equation root is:" << '/ n' << "/ t x1 =" << m << " " << n << "i" << '/ n' << " / T x2 = "<< m <<" - "<< n <<" i "<< '/ n' << endl;

}

}

Void get_du_dv (Double A, Double B, Double C, Double D, Double E, DOUBLE F)

{

DV = (B * D-A * E) / (c * e-b * f);

DU = (C * D-a * f) / (b * f-c * e);

}

void main ()

{

COUT << "Enter the factor of the four equations" << endl;

Double A4, A3, A2, A1, A0;

COUT << "A4 =";

CIN >> A4;

COUT << "A3 =";

CIN >> A3;

COUT << "A2 =";

CIN >> A2;

COUT << "A1 =";

CIN >> A1;

COUT << "A0 =";

CIN >> A0;

COUT << "/ n equation is: / n / t" << A4 << "(x * x * x * x) " << a3 << "(x * x * x) << A2 < <"(X * x) " << a1 << "(x) << A0 <<" = 0 "<< '/ n' << endl;

Double U, V;

COUT << "The constant item and one item coefficient of the input factor:" << Endl; cout << "u =";

CIN >> U;

COUT << "v =";

CIN >> V;

Cout << "/ n factor type is: / n / t w (x) =" << "(x * x) " << u << "(x) << V << endl;

Double P0, P1, P2, R0, R1;

P2 = a4;

P1 = A3-U * P2;

P0 = A2-V * P2-U * P1;

R0 = A1-V * P1-U * P0;

R1 = A0-V * P0;

Cout << "/ n / t (x) =" << p2 << "(x * x) " << p1 << "(x) " << p0 << "= 0" << ENDL;

Double PP3, PP2, PP1, PP0, R0V, R1V, R0U, R1U Download

PP3 = (- 1) * p2;

PP2 = (- 1) * P1;

PP1 = (- 1) * P0;

PP0 = 0;

R0V = u * p2-p1;

R1V = V * P2-P0;

R0U = R1V-U * R0V;

R1U = (- 1) * V * R0V;

GET_DU_DV (R0, R0U, R0V, R1, R1U, R1V);

SOLU_W (1, U DU, V DV);

}

转载请注明原文地址:https://www.9cbs.com/read-45759.html

New Post(0)