//例1.5
#include<iostream>
#include<math.h>
using namespace std;
float d, x, x1, x2;
void solution(float a, float b, float c)
{
d = b * b - 4 * a*c;
if (d > 0)
{
x1 = (-b + sqrt(d)) / (2 * a);
x2 = (-b - sqrt(d)) / (2 * a);
cout << "两个实根:" << "x1=" << x1 <<" "<< "x2=" << x2<<endl;
}
else if (d == 0)
{
x = (-b) / (2 * a);
cout << "一个实根:" << "x=" << x<<endl;
}
else
cout << "不存在实根"<<endl;
}
int main()
{
cin >> x >> x1 >> x2;
solution(x, x1, x2);
}//例1.5
#include<iostream>
#include<math.h>
usin