Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
308 B
1
Indexable
Never
#include <stdio.h>
#include <math.h>

int main(void)
{
	float a, b, c, d;
	a = scanf();
	b = scanf();
	c = scanf();
	d = b * b - 4 * a * c;
	if (d >= 0) {
		if (d == 0)
			printf(-b / (2 * a));
		else
			printf((-b + sqrt(d)) / (2 * a), (-b - sqrt(d)) / (2 * a));
	}
	else
		printf(-1);
}