#include <stdio.h>
#include <math.h>
/*
作者:
厦门理工学院
计算机与信息工程学院 FnLock
时间:2017年11月10日11:44:42
程序描述:
3_2二次方程求根
Time Limit:1000MS Memory Limit:65536K
Total Submit:5394 Accepted:1272
Description
输入参数a、b、c,求一元二次方程ax2+bx+c=0的根。
Input
三个实数a、b、c,并确保Δ≥0。
Output
方程两个实根,保留两位小数。
Sample Input
1 2 -8
Sample Output
x1=2.00 x2=-4.00
Source
*/
int main()
{
double a,b,c;
scanf("%lf %lf %lf",&a,&b,&c);
double x1,x2;
x1=(-b+sqrt(b*b-4*a*c))/(2*a);
x2=(-b-sqrt(b*b-4*a*c))/(2*a);
printf("x1=%.2lf x2=%.2lf",x1,x2);
return 0;
}