#include #include using namespace std; int main(int argc, char **argv) { float a, b, c; float delta; cout << "Entrez les coefficients:" << endl << "a: "; cin >> a; cout << "b: "; cin >> b; cout << "c: "; cin >> c; delta = b*b-4*a*c; if (delta < 0) cout << "Je ne sais pas calculer les racines dans ce cas." << endl; else { cout << "Les deux racines sont: " << endl; cout << "1) " << (-b+sqrt(delta))/2/a << endl; cout << "2) " << (-b-sqrt(delta))/2/a << endl; } return 0; }
- Wednesday
- December 25th, 2024
- Ajouter un cours