Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
364 B
0
Indexable
Never
#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;
	}
}