#include <stdio.h>
#include <math.h>
int main() {
double a, b, c, x1, x2;
printf("请输入一元二次方程的系数 a, b, c:\n"); scanf("%lf%lf%lf", &a
, &b
, &c
);
double delta = b * b - 4 * a * c;
if (delta > 0) {
x1
= (-b
+ sqrt(delta
)) / (2 * a
); x2
= (-b
- sqrt(delta
)) / (2 * a
); } else if (delta == 0) {
x1 = -b / (2 * a);
} else {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgppbnQgbWFpbigpIHsKICAgIGRvdWJsZSBhLCBiLCBjLCB4MSwgeDI7CiAgICBwcmludGYoIuivt+i+k+WFpeS4gOWFg+S6jOasoeaWueeoi+eahOezu+aVsCBhLCBiLCBj77yaXG4iKTsKICAgIHNjYW5mKCIlbGYlbGYlbGYiLCAmYSwgJmIsICZjKTsKCiAgICBkb3VibGUgZGVsdGEgPSBiICogYiAtIDQgKiBhICogYzsKCiAgICBpZiAoZGVsdGEgPiAwKSB7CiAgICAgICAgeDEgPSAoLWIgKyBzcXJ0KGRlbHRhKSkgLyAoMiAqIGEpOwogICAgICAgIHgyID0gKC1iIC0gc3FydChkZWx0YSkpIC8gKDIgKiBhKTsKICAgICAgICBwcmludGYoIuaWueeoi+acieS4pOS4quWunuaVsOino++8mlxuIik7CiAgICAgICAgcHJpbnRmKCJ4MT0lLjJmXG4iLCB4MSk7CiAgICAgICAgcHJpbnRmKCJ4Mj0lLjJmXG4iLCB4Mik7CiAgICB9IGVsc2UgaWYgKGRlbHRhID09IDApIHsKICAgICAgICB4MSA9IC1iIC8gKDIgKiBhKTsKICAgICAgICBwcmludGYoIuaWueeoi+acieS4gOS4quWunuaVsOino++8mlxuIik7CiAgICAgICAgcHJpbnRmKCJ4MT14Mj0lLjJmXG4iLCB4MSk7CiAgICB9IGVsc2UgewogICAgICAgIHByaW50Zigi5pa556iL5peg5a6e5pWw6Kej44CCXG4iKTsKICAgIH0KCiAgICByZXR1cm4gMDsKfQ==