View Code of Problem 42

#include "stdlib.h"
#include "algorithm"
#include "iostream"
#include <cstdio>
#include "string"
#include <iomanip>
#include <map>
#include <set>
#include "math.h"
using namespace std;
map<char, int> mp;
set<string> st;
int main()
{
	double a, b, c,d,e;
	cin >> a >> b >> c;
	d = -b + sqrt(pow(b, 2) - a * 4 * c);
	e= -b - sqrt(pow(b, 2) - a * 4 * c);
	d = d / 2 * a;
	e = e / 2 * a;
	printf("%.2f %.2f",d,e);
	return 0;
}

Double click to view unformatted code.


Back to problem 42