请大虾看一下这个c程序错在哪里 感激不尽!

[复制链接]
查看11 | 回复1 | 2008-11-1 20:59:34 | 显示全部楼层 |阅读模式
#include
#include
void main()
{
float a,b,c,x1,x2,disc;
scanf("%8.4f,%8.4f,%8.4f",&a,&b,&c);
if(fabs(a)=1e-6)
{x1=(-b+sqrt(disc))/(2*a);
x2=(-b-sqrt(disc))/(2*a);
printf("%8.4f,%8.4f\n,x1,x2");
}
else
{x1=-b/(2*a)+(sqrt(-disc)/(2*a))*i;
x2=-b/(2*a)-(sqrt(-disc)/(2*a))*i;

printf("%8.4f,%8.4f\n",x1,x2);
}
}
}/*求a x2+bx+c=0的解*/

回复

使用道具 举报

千问 | 2008-11-1 20:59:34 | 显示全部楼层
#include #include void main() { float a,b,c,x1,x2,disc; scanf("%8.4f,%8.4f,%8.4f",&a,&b,&c); if(fabs(a)=1e-6) {x1=(-b+sqrt(disc))/(2...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行