#include <stdio.h>
#include <math.h>
#include
using namespace std;
int main(void)
{
float a,b,c,d;
cout<<"Enter a, b, c: ";
cin>>a,b,c;
d=bb-4ac;
if(a==0)
{
if(b==0)
{
if(c==0)
cout<<"参数都为零,方程无意义! \n";
else
cout<<"a和b为0,c不为0,方程不成立\n";
}
else
cout<<"x="<<fixed<<setprecision(2)<<-c/b<<endl;</span><br /><span style="display:inline-block;text-indent:2em;"> }
else
{
if(d>=0)
{
cout<<"x1="<<fixed<<setprecision(2)<<(-b+sqrt(d))/(2</span></em>a)<<endl;<br /><span style="display:inline-block;text-indent:2em;"> cout<<"x2="<<fixed<<setprecision(2)<<(-b-sqrt(d))/(2</span><em>a)<<endl;<br /><span style="display:inline-block;text-indent:2em;"> }
else
{
cout<<"x1="<<fixed<<setprecision(2)<<-b/(2</span></em>a)<<" + "<<sqrt(-d)/(2*a)<<"i"<<endl;
cout<<"x2="<<fixed<<setprecision(2)<<-b/(2*a)<<" - "<<sqrt(-d)/(2*a)<<"i"<<endl;
}
}
return 0;
}
执行的结果不对 求解哪里出错了