2)
#include <iostream>
#include <math.h>
using namespace std;
int main() {
double a;
cin >> a;
double b;
cin >> b;
double c;
cin >> c;
cout << "Уравнение имеет следующий вид:\n";
cout << "(" << a << "x²)+(" << b << "x)+(" << c << ")=0\n\n";
cout << "Посчитаем дискриминант:\n";
double d = (b*b)-4*a*c;
cout << "D=(" << b << "²)-4*(" << a << ")*(" << c << ")" << endl;
cout << "D=(" << b*b << ")-(" << 4*a*c << ")\n";
cout << "D=" << d << "\n\n";
cout << "Теперь узнаем корни дискриминанта:\n";
double x1 = (-b-sqrt(d))/(2*a);
double x2 = (-b+sqrt(d))/(2*a);
cout << "x1=" << x1 << "\n";
cout << "x2=" << x2 << "\n";
return 0;
};
2)
#include <iostream>
#include <math.h>
using namespace std;
int main() {
double a;
cin >> a;
double b;
cin >> b;
double c;
cin >> c;
cout << "Уравнение имеет следующий вид:\n";
cout << "(" << a << "x²)+(" << b << "x)+(" << c << ")=0\n\n";
cout << "Посчитаем дискриминант:\n";
double d = (b*b)-4*a*c;
cout << "D=(" << b << "²)-4*(" << a << ")*(" << c << ")" << endl;
cout << "D=(" << b*b << ")-(" << 4*a*c << ")\n";
cout << "D=" << d << "\n\n";
cout << "Теперь узнаем корни дискриминанта:\n";
double x1 = (-b-sqrt(d))/(2*a);
double x2 = (-b+sqrt(d))/(2*a);
cout << "x1=" << x1 << "\n";
cout << "x2=" << x2 << "\n";
return 0;
};