View Code of Problem 42

#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main(){
	double a,b,c;
	double result1,result2;
	cin>>a>>b>>c;
	result1=(-b+sqrt(b*b-4*a*c))/(1.0*2*a);
	result2=(-b-sqrt(b*b-4*a*c))/(1.0*2*a);
	printf("%.2lf %.2lf",result1,result2);
} 

Double click to view unformatted code.


Back to problem 42