Квадратное уравнение

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <cmath> using namespace std; int main() { float a, b, c, D, x1, x2; std::cin >> a >> b >> c; std::cout << "Квадратное уравнение a * x ^ 2 + b * x + c = 0;" << std::endl; std::cout << "a = " << a << ";" << std::endl; std::cout << "b = " << b << ";" << std::endl; std::cout << "c = " << c << ";" << std::endl; D = pow(b,2) - 4 * a * c; std::cout << "D = " << D << ";" << std::endl; x1 = (-b + sqrt(D)) / 2 * a; x2 = (-b - sqrt(D)) / 2 * a; std::cout << "x1 = " << x1 << std::endl; std::cout << "x2 = " << x2 << std::endl; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines