View Code of Problem 42

#include<iostream>
#include <cmath>
using namespace std;
#pragma warning(disable:4996)

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

Double click to view unformatted code.


Back to problem 42