# include <iostream>
# include <cmath>
using namespace std;
int main()
{
double a,b,c,delta,x1,x2,d,e,f,g;
cin>>a>>b>>c;
d=b*b;
e=4*a*c;
delta=d-e;
if(delta<0)
{
cout<<"无解";
}
else
{
if(floor(sqrt(delta)+0.5)!=sqrt(delta))
{
f=-b;
cout<<(f)<<"+"<<"√"<<(delta)<<"/"<<(2*a)<<" "<<(f)<<"-"<<"√"<<(delta)<<"/"<<(2*a);
}
else
{
int h=(-b+sqrt(delta)),i=(2*a),j=(-b-sqrt(delta));
if(h%i!=0&&j%i!=0)
{
一元二次方程求解(c++)
最新推荐文章于 2023-10-28 17:42:51 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)