Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
373 B
4
Indexable
Never
#include<stdio.h>
#include<math.h>
int main(){
	float a, b, c, delta;
	scanf("%f%f%f", &a, &b, &c);
	
	if(a != 0){
		delta = pow(b, 2) - 4*a*c;
		if(delta > 0){
			printf("%.4f\n", ((-b + sqrt(delta)) / (2*a)));
			printf("%.4f", ((-b - sqrt(delta)) / (2*a)));
		}else if(delta == 0){
			printf("%.4f", (-b / (2*a)));
		}else{
			printf("No solution");
	}
}