#include "math.h"
#include "stdio.h"
void l(float h, float g ,float j)//要有函数申明
main()
{
float a,b,c,t,s;
printf("please enter a,b,c");
scanf("%f %f %f",&a,&b,&c); //输入的时候注意格式
if (fabs(a)<=1e-6)
{printf("is not a quadratic");}
else
{t=b*b-4*a*c;
s=-b;}
if (fabs(t)<1e-6)
{y(a,s);}
else if(t>1e-6)
{l(a,s,t);}
else
{x(a,s,t);}
}
void l(float h, float g ,float j) //要加上VOID
{float x1,x2;
x1=g+sqrt(j)/(2*h);
x2=g-sqrt(j)/(2*h);
printf("has two roots:%8.4f and %8.4f:\n",x1,x2);
}
…………
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试