View Code of Problem 42

#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;

int main() {
	double a, b, c;
	scanf("%lf,%lf,%lf", &a, &b, &c);
	double x,y1,y2;
	x = sqrt(b*b - 4*a*c);
	y1 = (-b + x) / (2 * a);
	y2 = (-b - x) / (2 * a);
	printf("%.2lf,%.2lf", y1, y2);
	return 0;
}

Double click to view unformatted code.


Back to problem 42