> 其他 >
关于c语言的 求ax的平方+bx+c=0方程的根,a,b,c由键盘输入,设b的平方-4ac>0
人气:293 ℃ 时间:2020-03-29 23:26:14
解答
#include "stdio.h"#include "math.h"main(){double a,b,c,x1,x2,dt,p,q;printf("please input a,b,c:");scanf("%lf%lf%lf",&a,&b,&c);if(b*b-4*a*c>=0){dt=sqrt(b*b-4*a*c);p=-b/(2*a);q=dt/(2*a);x1=p+q;x2=p-q;pr...
推荐
猜你喜欢
© 2026 79432.Com All Rights Reserved.
电脑版|手机版