fork(4) download
#include 
#include 

int main()
{
    std::complex a = 3.0;
    std::complex b = 2.0;
    std::complex c = 1.0;

    std::complex d = sqrt(pow(b,2)- 4.0*a*c);
    std::cout << "The answers are "
              << (-b + d)/(2.0*a) << " and " 
              << (-b - d)/(2.0*a) << '\n';
}
Success #stdin #stdout 0.02s 2812KB
stdin
Standard input is empty
stdout
The answers are (-0.333333,0.471405) and (-0.333333,-0.471405)