Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
317 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) / (2 * a);
	else if (d > 0) {
		cout << ((b-2*b) + sqrt(d)) / (2 * a) << ' ';
		cout << ((b-2*b) - sqrt(d)) / (2 * a);
	}
	else cout << "NO";
}