Untitled

Anonymous
c_cpp
10/15/2023 9:21 AM
360 B
14
Indexable
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int a, b, c, d;
    float x1, x2;
    cin >> a >> b >> c;
    d = b * b - 4 * a * c;
    x1 = (-b - sqrt(d)) / 2 / a;
    x2 = (-b + sqrt(d)) / 2 / a;
    cout << x1 << ' ' << x2;
}
Editor is loading...