主题:各位大哥 帮忙看一下怎么这个程序在c++运行不了???
#include<stdio.h>
main()
{float a,b,c,d,x1,x2;
printf("input a,b,c=");
scanf("%f,%f,%f",&a,&b,&c);
d=b*b-4*a*c;
if(d=0)
{x1=-b/(2*a);
x2=x1;
printf("x1=%f,x2=%f\n",x1,x2) ; }
else
if(d>0)
{x1=(-b+sqrt(d))/(2*a);
x2=(-b-sqrt(d))/(2*a);
printf("x1=%f,x2=%f\n",x1,x2);}
else
{x1=(-b+sqrt(-d))/(2*a);
x2=(-b-sqrt(-d))/(2*a);
printf("the function has two complexity roots:\n");
printf("x1=%f,x2=%f\n",x1,x2);}
while(1);
return 0;}
main()
{float a,b,c,d,x1,x2;
printf("input a,b,c=");
scanf("%f,%f,%f",&a,&b,&c);
d=b*b-4*a*c;
if(d=0)
{x1=-b/(2*a);
x2=x1;
printf("x1=%f,x2=%f\n",x1,x2) ; }
else
if(d>0)
{x1=(-b+sqrt(d))/(2*a);
x2=(-b-sqrt(d))/(2*a);
printf("x1=%f,x2=%f\n",x1,x2);}
else
{x1=(-b+sqrt(-d))/(2*a);
x2=(-b-sqrt(-d))/(2*a);
printf("the function has two complexity roots:\n");
printf("x1=%f,x2=%f\n",x1,x2);}
while(1);
return 0;}