求二元方程在根?看看那里不对?
#include<iostream.h>#include<math.h>
void main()
{
double a,b,c,x1,x2,m;
cout<<"please input three nummber for a b c :"<<endl;
cin>>a>>b>>c;
m=(b*b-4*a*c);
if(m<0)
cout<<"the fang cheng isn't answer:"<<endl;
else
{
x1=(-b+sqrt(m))/(2*a);
x2=(-b-sqrt(m))/(2*a);
cout<<"x1="<<x1<<"x2="<<x2<<endl;
}
}