// 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, just replace stdafx.h to Iostream.h, then remove "Using Namespace STD in the main function" "#Include" stdafx.h "#include" math.h "Using namespace std; double du, DV;
Void solu_w (double b, double c) {double TEM, TEM1; TEM1 = B * B-4 * C; Double M, N; M = (- 1) * B / 2; IF (Tem1> = 0) {TEM = SQRT (TEM1); N = TEM / 2; COUT << "/ n equation root root:" << '/ n' << "/ t x1 =" << m n << '/ n' << "/ t x2 =" << mn << endl;} else {TEM = SQRT ((- 1) * TEM1); N = TEM / 2; cout << "/ n equation root:" << '/ n '<< "/ t x1 =" << m << " " << n << "i" <<' / n '<< "/ t x2 =" << m << "-" << n << "i" << '/ n' << end1;}} void get_du_dv (Double A, Double B, Double C, Double D, Double E, Double F) {DV = (B * DA * E) / ( C * EB * f); DU = (C * DA * f) / (b * fc * e);}
Void main () {cout << "Enter the factor of the four equations" << Endl; double a [5]; double temp; for (int T = 4; t> = 0; t -) {cout << "/ ta [" << t << "] ="; cin >> Temp; a [t] = Temp;} cout << / n equation is: / n / t "<< a [4] << "(X * x * x * x) " << a [3] << "(x * x * x) "; cout << a [2] << "(x * x) << A [1] << "(x) << a [0] <<" = 0 "<< '/ n' << endl; double u, v; cout <<" input factor constant item and once Tie coefficient: "<< endl; cout <<" / tu = "; cin >> u; cout <<" / tv = "; cin >> v; cout <<" / n factor type: / n / tww (X) = "<<" (x * x) "<< u <<" (x) "<< V << Endl; Double P0, P1, P2, R0, R1;
Cout << "/ N input correction number:"; int count1; cin >> count1;
For (count1; count1> = 0; count1--) {p2 = a [4]; p1 = a [3] -u * p2; p0 = a [2] -V * p2-u * p1;
R0 = a [1] -V * P1-U * P0; R1 = a [0] -V * P0;
// The following line is added in the program, the problem will result in: If the number of corrections is too large, the program runtime is prolonged, and the main time is consumed on the screen display. // cout << "/ t p (x) =" << p2 << "(x * x) " << p1 << "(x) " << p0 << "= 0" << ENDL;
Double PP3, PP2, PP1, PP0, R0V, R1V, R0U, R1U; 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);
u = u dU; v = V DV;}
Solu_w (u, v);}