#include #include using namespace std; int main() { float a, b, c, delta, x0, x1, x2; cout << "Cet algorithme calcule les solutions de l'équation a*x^2+b*x+c=0" << endl; cout << "Entrez a:"; cin >> a; cout << "Entrez b:"; cin >> b; cout << "Entrez c:"; cin >> c; if (a == 0) { if (b != 0) { x0 = -c / b; cout << "x =" << x0 << endl; } else // ici b = 0 { if (c == 0) { cout <<"infinite de solutions" << endl; } else { cout <<"aucune solution" << endl; } } } else { delta = b*b-4*a*c; if (delta <0) { cout <<"aucune solution" << endl; } else { if (delta == 0) { x0=-b/(2*a); cout << "x =" << x0 << endl; } else { x1 = (-b-sqrt(delta))/(2*a); x2 = (-b+sqrt(delta))/(2*a); cout << "Il y a 2 racines réelles x1 =" << x1 << " et x2 =" << x2 <