How to solve a problem? Tell me please.
#include <conio.h> #include <iostream> #include <cmath> using std :: cout; using std :: cin; using std :: endl; int main() { setlocale(0, "russian"); double a, b, c; double d; double x, x2; cout << "Enter a,b,c" << endl; cout << "a="; cin >> a; cout << "b="; cin >> b; cout << "c="; cin >> c; d = (b*b) - (4 * a* c); cout << "D=" << d << endl; if (d < 0) cout << "No roots!" << endl; if (d == 0) x = -b / (2 * a); cout << "X=" << x << endl; if (d > 0) x = (-b + sqrt(d)) / (2 * a); cout << "X1=" << x << endl; x2 = (-b - sqrt(d)) / (2 * a); cout << "X2=" << x2 << endl; _getch(); return 0; }