Untitled
unknown
plain_text
2 years ago
364 B
4
Indexable
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float a, b, c,d;
cin >> a >> b >> c;
d = (b * b) - (4 * a * c);
if (d > 0)
{
cout << (-b - sqrt(d)) / (2 * a) << endl;
cout << (-b + sqrt(d)) / (2 * a) << endl;
}
if (d == 0)
{
cout << (-b) / (2 * a) << endl;
}
if (d < 0)
{
cout << "NO" << endl;
}
}Editor is loading...