View Code of Problem 42

#include <iostream>
#include <cstdio>
#include <math.h>
#include <string>
using namespace std;
int main(){
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	double k=sqrt(b*b-4*a*c);
	double x1=(-b+k)/2*a;
	double x2=(-b-k)/2*a;
	printf("%0.2f %0.2f",x1,x2);
}

Double click to view unformatted code.


Back to problem 42