用一个自写函数求根,哪里有错?
#include #include "simpio.h"
int Geng (int a, int b, int c)
{
int x,y,d;
d==b*b-4*a*c;
x=(-b+sqrt(d))/2*a&&y=(-b-sqrt(d))/2*a
return (Geng);
}
main()
{
int a,b,c;
printf("Enter coefficients for the quadratic equation:\n");
printf("a:\n");
a = GetInteger();
printf("b:\n");
b = GetInteger();
printf("c:\n");
c = GetInteger();
printf("The first solution is %d\n",x);
printf("The second solution is %d\n",y);
return 0;
}