c语言写二元一次方程#include#include#includeint main(void){ double a,b,c,x1,x2; scanf("%lf%lf%lf",&a,&b,&c); x1=(-b+sqrt(b*b-4*a*c))/(2*a); x2=(-b-sqrt(b*b-4*a*c))/(2*a); if(b*b-4*a*c>=0) x1=x1; x2=x2;else x1=0;x2=0; printf("%lf%lf",
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 22:49:02
c语言写二元一次方程#include#include#includeint main(void){ double a,b,c,x1,x2; scanf("%lf%lf%lf",&a,&b,&c); x1=(-b+sqrt(b*b-4*a*c))/(2*a); x2=(-b-sqrt(b*b-4*a*c))/(2*a); if(b*b-4*a*c>=0) x1=x1; x2=x2;else x1=0;x2=0; printf("%lf%lf",
c语言写二元一次方程
#include
#include
#include
int main(void)
{
double a,b,c,x1,x2;
scanf("%lf%lf%lf",&a,&b,&c);
x1=(-b+sqrt(b*b-4*a*c))/(2*a);
x2=(-b-sqrt(b*b-4*a*c))/(2*a);
if(b*b-4*a*c>=0) x1=x1; x2=x2;else x1=0;x2=0;
printf("%lf%lf",x1,x2);
system("pause");
return 0;
}
才学c求指导哪里错了
c语言写二元一次方程#include#include#includeint main(void){ double a,b,c,x1,x2; scanf("%lf%lf%lf",&a,&b,&c); x1=(-b+sqrt(b*b-4*a*c))/(2*a); x2=(-b-sqrt(b*b-4*a*c))/(2*a); if(b*b-4*a*c>=0) x1=x1; x2=x2;else x1=0;x2=0; printf("%lf%lf",
if(b*b-4*a*c>=0) x1=x1; x2=x2;else x1=0;x2=0;
是不是你这儿没有用大括号的原因?