c疑问(大家帮忙找下错误)我是新手谢谢
int main ( ) {
double A,B,C,x1,x2,x;
printf ("请输入三个数字: ");
scanf ("%1f %1f %1f",&A,&B,&C);
if (A==0.0)
{
if (B==0.0)
printf ("Error");
else
printf ("x=%f\n",-C/B);
}
else if (B==0.0)
{
if (A*C>=0.0)
printf ("x1=+j%f,x2=-j%f\n",sqrt(C/A),sqrt(C/A));
else
printf ("x1=+%f,x2=-%f\n",sqrt(-C/A),sqrt(-C/A));
}
else if (B*B-4*A*C>=0.0)
printf ("x1=%f,x2=%f\n",(-B-sqrt(B*B-4*A*C))/(2*A),C/(A*x1));
else
printf ("x1=%f+j%f,x2=%f-j%f ",-B/(2A),sqrt(B*B-4*A*C)/2A,-B/(2A),sqrt(B*B-4*A*C/2A ));
system ("pause");
return 0;
}
该程序目的是解一元二次方程A*x*x+B*X+C=0,但结果却是“ invalid suffix "A" on integer constant ”。不知何意?请求指点,不胜感激