Home > Back-end >  How to call this function? To solve the
How to call this function? To solve the

Time:06-03

Int solution (double a, b double, double c, double & amp; X1, double & amp; X2)
{
Double d;
D=b * * a * b - 4 c.
If (if d> 0)
{
X1=(a - b + SQRT (d))/(2 * a);
X2=(a - b + SQRT (d))/(2 * a);
Return 2;
}
Else if (d==0)
{
X1=(a - b)/(2 * a);
return 1;
}
The else
return 0;
}

CodePudding user response:

A function call directly in not line?
Double a, b, c, x1, x2,
.//for each variable assignment,
Solution (a, b, c, x1, x2);

CodePudding user response:

reference 1st floor fireyou response:
function call directly in not line?
Double a, b, c, x1, x2,
.//for each variable assignment,
Solution (a, b, c, x1, x2);

Bosses, can't ah, give write full point

CodePudding user response:

Ask questions should be clear, the problem is very difficult for others to guess, you this function is avoids solving quadratic equation? A, b, c equation coefficient, x1, x2 used to receive the equation root,

CodePudding user response:

The
reference 3 floor csucxy response:
questions should be clear, the problem is very difficult for others to guess, you is this function avoids solving quadratic equation? A, b, c equation coefficient, x1, x2 used to receive the equation root,

This is the design algorithm, a yuan quadratic equation ax ^ 2 + bx + c=o

CodePudding user response:

Double x1, x2,
Int num=solution (31, 1 x1, x2);

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related