求根和根判别
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
double a, b, c, r1, r2;
cin >> a >> b >> c;
if((b * b - 4 * a * c < 0) || a == 0) printf("Impossivel calcular");
else
{
r1 = (- b + sqrt(b * b - 4 * a * c)) / (2 * a);
r2 = (- b - sqrt(b * b - 4 * a * c)) / (2 * a);
printf("R1 = %.5lf\nR2 = %.5lf\n", r1, r2);
}
}