33,311
社区成员
发帖
与我相关
我的任务
分享
#include "math.h"
#include <stdio.h>
main()
{
float a,b,c,p,x1,x2;
printf("请输入a,b,c");
scanf("%f,%f,%f",&a,&b,&c);
p=b*b-4*a*c;
x1=(-b+sqrt(p))/(2*a);
x2=(-b-sqrt(p))/(2*a);
printf("x1=%6.2f\n x2=%6.2f\n", x1, x2);
}