View Code of Problem 42

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

int main() {
	int a, b, c;
	scanf("%d %d %d", &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("%.2f,%.2f", y1, y2);
	return 0;
}

Double click to view unformatted code.


Back to problem 42