#include<iostream>
#include<cmath>
using namespace std;
int main()
{
float a,b,c,d,root1,root2;
cout<<"Enter 3 coefficients";
cin>>a>>b>>c;
d=b*b-4*a*c;
if(d>0)
{
root1=(-b+sqrt(d))/(2*a);
root2=(-b+sqrt(d))/(2*a);
cout<<"roots are real and unequal";
cout<<root1<<root2;
}
else if(d==0)
{
root1=-b/(2*a);
cout<<"roots are real and unequal";
cout<<root1;
}
else
{
cout<<"roots are complex and imaginary";
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGNtYXRoPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpCnsKCWZsb2F0IGEsYixjLGQscm9vdDEscm9vdDI7Cgljb3V0PDwiRW50ZXIgMyBjb2VmZmljaWVudHMiOwoJY2luPj5hPj5iPj5jOwoJZD1iKmItNCphKmM7CglpZihkPjApCgl7CgkJcm9vdDE9KC1iK3NxcnQoZCkpLygyKmEpOwoJCXJvb3QyPSgtYitzcXJ0KGQpKS8oMiphKTsKCQljb3V0PDwicm9vdHMgYXJlIHJlYWwgYW5kIHVuZXF1YWwiOwoJCWNvdXQ8PHJvb3QxPDxyb290MjsKCX0KCWVsc2UgaWYoZD09MCkKCXsKCQlyb290MT0tYi8oMiphKTsKCQljb3V0PDwicm9vdHMgYXJlIHJlYWwgYW5kIHVuZXF1YWwiOwoJCWNvdXQ8PHJvb3QxOwoJfQoJZWxzZQoJewoJCWNvdXQ8PCJyb290cyBhcmUgY29tcGxleCBhbmQgaW1hZ2luYXJ5IjsKCX0KCXJldHVybiAwOwp9