#include <stdio.h>
void fun1(float a,float b,double delt)
{
double x[2];
x[0] = -b/(2*a)-sqrt(delt)/(2*a);
x[1] = -b/(2*a)+sqrt(delt)/(2*a);
printf("The two roots of equation : %f,%f\n",x[0],x[1]);
}
void fun2(float a,float b,double delt)
{
double x[2];
x[0] = -b/(2*a);
x[1] = x[0];
printf("The two equal roots of equation : %f, %f\n",x[0],x[1]);
}
void fun3(float a,float b,double delt)
{
printf(" the equation has no int root!");
}
void main()
{
int a,b,c;
double delt;
printf("input the cof:");
scanf("%d %d %d",&a,&b,&c);
delt = b*b - 4*a*c;
if(delt > 0)
{
fun1(a,b,delt);
}
else if(delt == 0)
{
fun2(a,b,delt);
}
else
{
fun3(a,b,delt);
}
}