Untitled

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

int main()
{
    float x;
    cin >> x;
    float y;
    cin >> y;
    float c;
    cin >> c;
    float result;
    float d;
    float kor;
    d = y * y - 4 * x * c;
    kor = sqrt(d);
    if (d > 0) {
        result = (-y + kor) / (2 * x);
        cout << result;
        result = (-y - kor) / (2 * x);
        cout << result;
    }
    else if (d == 0) {
        result = (-y) / (2 * x);
    }
    else cout << 'NO';
}