【在线等】【哪里有问题?】解一元二次方程的C程序#include #include main(){ double a,b,c,d,x1,x2; printf("Please input 3 number,use ',' to separate them\n"); scanf("%lf,l%f,%lf",&a,&b,&c); d=b*b-4*a*c; x1=(-b+sqrt(d))/2*a; x2=(-b-sq

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 15:36:50
【在线等】【哪里有问题?】解一元二次方程的C程序#include#includemain(){doublea,b,c,d,x1,x2;printf("Pleaseinput3number,use'',''

【在线等】【哪里有问题?】解一元二次方程的C程序#include #include main(){ double a,b,c,d,x1,x2; printf("Please input 3 number,use ',' to separate them\n"); scanf("%lf,l%f,%lf",&a,&b,&c); d=b*b-4*a*c; x1=(-b+sqrt(d))/2*a; x2=(-b-sq
【在线等】【哪里有问题?】解一元二次方程的C程序
#include
#include
main()
{
double a,b,c,d,x1,x2;
printf("Please input 3 number,use ',' to separate them\n");
scanf("%lf,l%f,%lf",&a,&b,&c);
d=b*b-4*a*c;
x1=(-b+sqrt(d))/2*a;
x2=(-b-sqrt(d))/2*a;
if (fabs(d)1e-6) printf("the Answer of ax^2+bx+c=0 is x1=%8.1lf,x2=%8.1lf\n",x1,x2);
else printf("the Answer of ax^2+bx+c=0 is none\n");
}

【在线等】【哪里有问题?】解一元二次方程的C程序#include #include main(){ double a,b,c,d,x1,x2; printf("Please input 3 number,use ',' to separate them\n"); scanf("%lf,l%f,%lf",&a,&b,&c); d=b*b-4*a*c; x1=(-b+sqrt(d))/2*a; x2=(-b-sq
scanf("%lf,
(这里有问题应该是%lf)
,%lf",&a,&b,&c);