我已经再主函数中定义了这个数了啊?为什么红色这里还是现实没有定义?
#include "stdio.h"#include "math.h"
main(void)
{
float genone(int a,int b);
float gentwo(int a,int b);
int a,b,c,x1,x2;
float d;
printf("input 3 numbers:");
scanf("%d,%d,%d,",&a,&b,&c);
d=b*b-4*a*c;
if(d>0)
{
x1=genone(a,b);
x2=gentwo(a,b);
}
else if(d==0)
x1=x2=gen1(a,b,c);
else
printf("There is no answer.");
}
float genone(int a,int b)
{
float n=(-b+sqrt(d))/(2*a);
return n;
}
float gentwo(int a,int b)
{
float m=(-b-sqrt(d))/(2*a);
return m;
}