1.化方程为一般式:
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D156/sign=2cee3e47a71ea8d38e227001a10b30cf/80cb39dbb6fd5266cf02b5e8aa18972bd4073624.jpg)
2.确定判别式,计算Δ(
希腊字母,音译为戴尔塔)。
;
![](https://gss1.bdstatic.com/-vo3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D86/sign=96260cb2cb8065387feaa91596ddc2b6/71cf3bc79f3df8dcd435066dcc11728b461028c5.jpg)
3.若Δ>0,该方程在
实数域内有两个不相等的实数根:;
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D133/sign=a209dbbc46166d223c77119775220945/5243fbf2b2119313478ca3c760380cd790238dfe.jpg)
若Δ=0,该方程在实数域内有两个相等的
实数根:
;
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D99/sign=30aa9eb39f2f07085b052609e824b203/5882b2b7d0a20cf486d1722377094b36adaf998d.jpg)
若Δ<0,该方程在实数域内无解,但在虚数域内有两个共轭复根,为
![](https://gss3.bdstatic.com/7Po3dSag_xI4khGkpoWK1HF6hhy/baike/s%3D139/sign=08ef0d4ecc3d70cf48faae0ec1ddd1ba/e7cd7b899e510fb378f528e0dc33c895d0430cdc.jpg)
#include <stdio.h>
#include <math.h>
int main()
{
float a=5,b=400,c=34,delt,x1,x2;
printf("输入方程的三个系数:");
//scanf("%f%f%f",&a,&b,&c);
delt = b*b-4*a*c;
printf("输入方程的三个系数:%.2f",delt);
x1 = (-b+sqrt(delt))/(2*a);
x2 = (-b-sqrt(delt))/(2*a);
printf("方程的解分别为:x1=%.2f x2=%.2f \n",x1,x2);
}