sb

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
474 B
0
Indexable
Never
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	double a, b, c;
	double D = 0, D1 = 0;
	double x1 = 0, x2 = 0, x = 0;
	cin >> a >> b >> c;
	D = (b * b) - (4 * a * c);
	D1 = sqrt(D);
	if (D > 0)
	{
		cout << "2" << endl;
		x1 = (-b + D1) / (2 * a);
		x2 = (-b - D1) / (2 * a);
		cout << x1 << " "  << x2;
	}
	else if (D == 0)
	{
		cout << "1" << endl;
		x = ( - b + D1) / (2 * a);
		cout << x;
	}
	else cout << "No koren";
}