求一元二次方程的根
最后一个else没有对应的if,请问怎么解决。
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char argv[]) {
double a,b,c,d,x1,x2;
printf("请依次输入三个系数:");
scanf("3%lf",&a,&b,&c);
d=bb-4ac;
if(a==0)
printf("输入的第一个值不能等于0");
else
{ if(d>=0)
x1=(-b+sprt(d))/(2a);
x2=(-b-sprt(d))/(2a);
printf("%lf%lf\n",&x1,&x2);
else
printf("无实根");
}
return 0;
}