调试没有错误,但是运行不出结果?

#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a,b,c,x1,x2,d;
double i;
cin>>a>>b>>c;
d=b*b-4*a*c;
if (a=0)
cout<<"该方程不是一元二次方程";
else if (d>0)
x1=(-b+sqrt(b*b-4*a*c))/2*a;
x2=(-b-sqrt(b*b-4*a*c))/2*a;
if (d=0)
x1=x2=-b/2*a;
else if (d<0)
x1=(-b+i*sqrt(b*b-4*a*c))/2*a;
x2=(-b-i*sqrt(b*b-4*a*c))/2*a;
return 0;
}

if(a==0)
if(b==0)
判断要用双等于,=是赋值
温馨提示:答案为网友推荐,仅供参考
相似回答