Home > Back-end >  Ask help bosses
Ask help bosses

Time:03-14

Bosses, why is this string of code output result what also have no? (please more attention of new road)
#include
#include
using namespace std;
Int main ()
{
Double a, b, c, x, y, z, x1, x2,
Cin> A> B> c;
Y=b * * a * b - 4 c.
Z=(-) c/b;
X1=((b) + SQRT (y))/(2 * a);
X2=(b (-) - SQRT (y))/(2 * a);
If (a!=0 & amp; & b!=0)
{if (y> 0)
{if (x1 & gt; X2)
Cout<& lt;" X1="& lt; }
The else
If (a==0 & amp; & b!=0)
Cout<& lt;" X="& lt; The else
Cout<& lt;" No value "& lt; return 0;

}

CodePudding user response:

Reference:
 # include 
#include
using namespace std;
Int main ()
{
Double a, b, c, x, y, z, x1, x2,
Cin> A> B> c;
Y=b * * a * b - 4 c.
If (a!=0 & amp; & b!=0)
{
X1=((b) + SQRT (y))/(2 * a);
X2=(b (-) - SQRT (y))/(2 * a);
If (y> 0)
{
If (x1 & gt; X2)
Cout<& lt;" X1="& lt; }
The else
If (a==0 & amp; & b!=0)
{
Z=(-) c/b;
Cout<& lt;" X="& lt; }
The else
Cout<& lt;" No value "& lt;
return 0;
}

CodePudding user response:

Correction: upstairs
 # include 
#include
using namespace std;
Int main ()
{
Double a, b, c, x, y, z, x1, x2,
Cin> A> B> c;
Y=b * * a * b - 4 c.
If (a!=0 & amp; & b!=0 & amp; & Y>=0)
{
X1=((b) + SQRT (y))/(2 * a);
X2=(b (-) - SQRT (y))/(2 * a);
If (y> 0)
{
If (x1 & gt; X2)
Cout<& lt;" X1="& lt;
return 0;
}
  • Related