#include <stdafx.h>
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
float a,b,c,delta,x1,x2;
cout << "Podaj liczby a,b,c dla funkcji ax^2+bx+c: "<<endl;
cout<< "a:";
cin >> a;
cout<< "b:";
cin >> b;
cout<< "c:";
cin >> c;
cout<< "Funckja ma postac:" << a << "x^2+" << b <<"x+" << c <<endl;
delta=b*b-4*a*c;
cout<<"Delta wynosi:"<< delta <<endl;
if(delta < 0) {
cout << "Brak rozwiazania" <<endl;
}
if(delta == 0) {
float x0= -b/2*a;
cout<< "Rozwiazanie to x0="<< x0 <<endl;
}
if(delta > 0) {
x1=(-b-sqrt(delta))/(2*a);
x2=(-b+sqrt(delta))/(2*a);
cout << "x1=" << x1 <<endl;
cout << "x2=" << x2 <<endl;
}
return 0;
}