韦达定理
#include<iostream>using namespace std;
int main()
{
float a = 0., b = 0., c = 0.,x1 = 0., x2 = 0., m = 0.;
cin >> a, b, c;
m = b*b - 4 * a*c;
if (m >= 0) {
x1 = (-b + sqrt(m)) / (2 * a);
x2 = (-b - sqrt(m)) / (2 * a);
cout << x1, x2;
}
else cout << "无解";
system("pause");
return 0;
}