C语言计算一元二次方程的根.求指出错误#include #include int main(void){float a,b,c,d,x1,x2;char ans;printf("Enter the coefficients of the quadratic equation>");scanf("%f\t%f\t%f",&a,&b,&c);if(a =0 && d >=0){d=pow(b,2)-4*a*c;x1=(-b+sqrt

来源:学生作业帮助网 编辑:作业帮 时间:2024/09/06 10:40:56
C语言计算一元二次方程的根.求指出错误#include #include int main(void){float a,b,c,d,x1,x2;char ans;printf(");scanf("%f\t%f\t%f",&a,&b,&c);if(a =0 && d >=0){d=pow(b,2)-4*a*c;x1=(-b+sqrt" />
xMo0Oϊ.mڊa#eqH9QMhB mq@; 'm[&Mve:\o}5LJIqlwx~lw.^Z7g &s6H26,6j,.!يPٶ]b%vCt~lC@@P:zňқ ~Q#Xшa=| b1Ou+_Uhdĭ8l-ywM\Q״N1c#3&ǟT^BGiZ&2ĬЊ(Q1;6UI.D!ʪU0~{ض4WZ;nwB]2xZ*8[Nd "=DpcH2ڧë->i^_|z{Yvv+A0"XiJ䁹)xiym$穵`#ƒ6\a@M=Y$T#%a(b,3 ԂRs$I͙BofU9{o<;o/JA7sX+R -#c0+,{%״@ D]}(e1; l"P\>YcK:Ldt]т.']oRtإ?l <'W Ra1 b

C语言计算一元二次方程的根.求指出错误#include #include int main(void){float a,b,c,d,x1,x2;char ans;printf("Enter the coefficients of the quadratic equation>");scanf("%f\t%f\t%f",&a,&b,&c);if(a =0 && d >=0){d=pow(b,2)-4*a*c;x1=(-b+sqrt
C语言计算一元二次方程的根.
求指出错误
#include
#include
int main(void)
{
float a,b,c,d,x1,x2;
char ans;
printf("Enter the coefficients of the quadratic equation>");
scanf("%f\t%f\t%f",&a,&b,&c);
if(a =0 && d >=0)
{
d=pow(b,2)-4*a*c;
x1=(-b+sqrt(d))/(2*a);
x2=(-b-sqrt(d))/(2*a);
printf("x1=%f\tx2=%f",x1,x2);
printf("Do you want to solve another quadratic equation(y/n)?>");
fflush(stdin);
scanf("%c",&ans);
}
else
{
prinft("wrong");
}
return(0);
}
gcc -lm 1.c 之后
出现如下问题
看不懂
Undefined first referenced
symbol in file
prinft /var/tmp//ccEWqWlc.o
ld:fatal:Symbol referencing errors.No output written to a.out
collect2:ld returned 1 exit status

C语言计算一元二次方程的根.求指出错误#include #include int main(void){float a,b,c,d,x1,x2;char ans;printf("Enter the coefficients of the quadratic equation>");scanf("%f\t%f\t%f",&a,&b,&c);if(a =0 && d >=0){d=pow(b,2)-4*a*c;x1=(-b+sqrt
/*结束程序请按“Ctrl+z”*/
#include
#include
int main()
{
float a, b, c;
double d, x1, x2;
printf("Enter the coefficients of the quadratic equation>\n");
while(scanf("%f\t%f\t%f", &a, &b, &c)!=EOF)
{
double d;
d=pow(b,2)-4*a*c;
 if((a!=0&&d>=0)!=EOF)
{
x1=(-b+sqrt(d))/(2*a);
x2=(-b-sqrt(d))/(2*a);
printf("x1=%lf\tx2=%lf\n", x1, x2);
}
printf("Enter the coefficients of the quadratic equation>\n");
}
return 0;
}