Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
429 B
0
Indexable
Never
#include <iostream>
using namespace std;


int main()
{
	setlocale(LC_ALL, "Russian");
	int a, b, c;
	int d;
	float x1, x2;
	float x;
	cin >> a >> b >> c;
	d = (b * b) - 4 * a * c;
	if (d < 0) {
		cout << "Корней нет";
	}
	if (d > 0) {
		x1 = (-b - sqrt(d)) / (2 * a);
		x2 = (-b + sqrt(d)) / (2 * a);
		cout << x1 << endl;
		cout << x2;
	}
	if (d == 0) {
		x = -b / (2 * a);
		cout << x;
	}	
}