#include<stdio.h>
#include<conio.h>
#include<math.h>
void main ()
{
float a,b,c,dt;
printf("Cho biet 3 he so a,b,c cua phuong trinh:");
scanf("%f%f%f",&a,&b,&c);
if (a==0) printf("Nhap lai 3 he so cua phuong trinh"),scanf("%f%f%f",&a,&b,&c);
else dt=(b*b) - (4*a*c);
if (dt<0) printf("\nPhuong trinh vo nghiem");
else
if (dt == 0)
printf("Phuong tring co hai nghiem kep \nX1 = X2 = %f",-b/(2*a));
else
{
if (dt > 0) printf("Phuong trinh co hai nghiem phan biet \nX1= %f",(-b+sqrt(dt))/(2*a));
printf("\nX2 = %f",(-b-sqrt(dt))/(2*a));
}
getch();
}