Untitled
unknown
c_cpp
2 years ago
429 B
8
Indexable
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int a, b, c;
int d;
float x1, x2;
float x;
cin >> a >> b >> c;
d = (b * b) - 4 * a * c;
if (d < 0) {
cout << "Корней нет";
}
if (d > 0) {
x1 = (-b - sqrt(d)) / (2 * a);
x2 = (-b + sqrt(d)) / (2 * a);
cout << x1 << endl;
cout << x2;
}
if (d == 0) {
x = -b / (2 * a);
cout << x;
}
}Editor is loading...