Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
360 B
1
Indexable
Never
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	double a, b, c;
	double D;
	cin >> a >> b >> c;
	D = pow(b,2) - 4 * a * c;
	if (D == 0)
	{
		cout << -b / (2 * a);
	}
	else if (D > 0)
	{
		cout << ( - b + sqrt(D)) / (2 * a) << " ";
		cout << ( - b - sqrt(D)) / (2 * a);
	}
	else
	{
		cout << "NO";
	}
	return 0;
}