View Code of Problem 42

#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
	double a,b,c,dt,x1,x2;
	cin>>a>>b>>c;
	
	dt=sqrt(b*b-4*a*c);
	
	x1=(-b+dt)/(2*a);
	x2=(-b-dt)/(2*a);
	
	
	cout<<fixed<<setprecision(2)<<x1<<" "<<fixed<<setprecision(2)<<x2<<endl;
}

Double click to view unformatted code.


Back to problem 42