View Code of Problem 42

#include<iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <cmath>
using namespace std;
#pragma warning(disable:4996)


int main() {
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	double x1,x2, temp;
	temp = sqrt(b*b - 4 * a*c);
	x1 = (-b + temp) / (2*a);
	x2 = (-b - temp) / (2*a);
	printf("%.2lf %.2lf", x1, x2);

	return 0;
}	
/*
Main.c:1:19: fatal error: iostream: No such file or directory
 #include<iostream>
                   ^
compilation terminated.
*/

Double click to view unformatted code.


Back to problem 42