View Code of Problem 42

#include<cstdio>
#include<cmath>
int main(){
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	double ans1,ans2;
	ans1=(-1*b+sqrt(b*b-4*a*c))/(2*a);
	ans2=(-1*b-sqrt(b*b-4*a*c))/(2*a);
	printf("%.2lf %.2lf",ans1,ans2);
	return 0;
} 

Double click to view unformatted code.


Back to problem 42