#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
float a=0,b=0,c=0;
float reading()
{
char A[64],B[64],C[64];
ifstream input("IN.txt");
input.getline(A,sizeof(A));
input.getline(B,sizeof(B));
input.getline(C,sizeof(C));
a=atof(A);
b=atof(B);
c=atof(C);
return a,b,c;
}
float calc(float a,float b, float c)
{
float D=(b*b - 4*a*c);
cout<<"D = "<<D<<endl;
if(D>0)
{
cout<<"X1 = "<<((-b+sqrt(D))/(2*a))<<endl;
cout<<"X2 = "<<((-b-sqrt(D))/(2*a))<<endl;
}
else if(D==0)
{
cout<<"X = "<<(-b/2*a);
}
else cout<<"no solutions";
}
int main()
{
reading();
cout<<"a="<<a<<endl<<"b="<<b<<endl<<"c="<<c<<endl;
calc(a,b,c);
getchar();
return 0;
}
I2luY2x1ZGUgPGZzdHJlYW0+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8bWF0aC5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKZmxvYXQgYT0wLGI9MCxjPTA7CgpmbG9hdCByZWFkaW5nKCkKewoJY2hhciBBWzY0XSxCWzY0XSxDWzY0XTsKCglpZnN0cmVhbSBpbnB1dCgiSU4udHh0Iik7CglpbnB1dC5nZXRsaW5lKEEsc2l6ZW9mKEEpKTsKCWlucHV0LmdldGxpbmUoQixzaXplb2YoQikpOwoJaW5wdXQuZ2V0bGluZShDLHNpemVvZihDKSk7CglhPWF0b2YoQSk7CgliPWF0b2YoQik7CgljPWF0b2YoQyk7CglyZXR1cm4gYSxiLGM7Cn0KCmZsb2F0IGNhbGMoZmxvYXQgYSxmbG9hdCBiLCBmbG9hdCBjKQp7CglmbG9hdCBEPShiKmIgLSA0KmEqYyk7Cgljb3V0PDwiRCA9ICI8PEQ8PGVuZGw7CglpZihEPjApCgoJewoJCWNvdXQ8PCJYMSA9ICI8PCgoLWIrc3FydChEKSkvKDIqYSkpPDxlbmR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