c语言编程输入abc输出一元二次方程ax^2+bx+c的根,,求大神编程,,if语句...答:include <stdio.h>#include <math.h>int main(){ float a, b, c, d, r1, r2; scanf("%f%f%f", &a, &b, &c); d = b * b - 4 * a * c; if (d > 0) { r1 = (-b + sqrt(d)) / (2 * a); r2 = (-b - sqrt(d)) / (2 * a); printf("解:%f,...
一道关于C语言求一元二次方程根的问题答:您好!很高兴为您解答。如果刨除输入格式的问题,输入的那一行“scanf("%1f,%1f,%1f",&a,&b,&c);”应该改为“scanf("%lf,%lf,%lf",&a,&b,&c);”,即把“1f”改成“lf”。修改后的运行结果:望采纳~如您还有不解,欢迎追问~
用C++ 计算 求一元二次方程 的根,其中系数a,b,c为实数,由键盘输入答:a为二元方程的二次项系数,b为一次项系数,c为常数项。include <stdio.h> include <math.h> int main(){ int a,b,c;double x1,x2,m;printf("输入a,b,c的值\n");scanf("%d %d %d",&a,&b,&c);if(a == 0){ printf("you enter a wrong number\n");} printf("%d %d %d...