乔童曲吧 关注:8贴子:432
  • 6回复贴,共1
#include<stdio.h>
#include<math.h>
float d1(float a,float b,float c)
{
float w;
w=b*b-4*a*c;
return w;
}
void d2(float a,float b,float c)
{
printf("两个实根\n");
printf("%f",(-b+sqrt(d1(a,b,c)))/(2*a));
printf("%f",(-b-sqrt(d1(a,b,c)))/(2*a));
}
void d3(float a,float b)
{
printf("一个实根\n");
printf("%f",(-b)/(2*a));
}
void d4()
{
printf("没根");
}
void main()
{
float a,b,c;
scanf("%f,%f,%f",&a,&b,&c);
if(d1>0) d2(a,b,c);
if(d1==0) d3(a,b);
if(d1<0) d4();
}


1楼2016-05-18 09:03回复
    S B


    IP属地:上海来自Android客户端2楼2016-05-20 05:17
    收起回复
      2025-06-29 08:28:58
      广告
      Hello?


      IP属地:广东来自Android客户端3楼2016-05-23 10:34
      收起回复