Problem2184--Stub function

2184: Stub function

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 0
[Submit] [Status] [Web Board] [Creator:]

Description

This problem requires writing a program to call the following function. double root( double a, double b, double c); // Precondition: a != 0 and a, b, c are coefficients of // a quadratic equation a*x*x + b*x + c = 0 // Postcondition: return value, x, satisfies the // equation a*x*x + b*x + c = 0

Input

Given three double types of data a, b, c and an integers i, which is either +1 or -1 to choose which root.

Output

the roots

Sample Input Copy

1 -3 2

Sample Output Copy

1 2

Source/Category

4