#include <stdio.h> #include <string.h> #include <stdlib.h> #include <limits.h> #include <math.h> int main() { int a, b, c; while (scanf("%d%d%d", &a, &b, &c) != EOF) { double s = sqrt(b * b * 1.0 - 4 * a * c); printf("%.2lf %.2lf\n", (-b + s) / 2 / a, (-b - s) / 2 / a); } } |
Double click to view unformatted code.