fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <complex>
  4. using namespace std;
  5. int main()
  6. {
  7. double u,v,r,im;
  8. u=1.0;v=2.0;
  9. r=(v-u)/2.;
  10. im=(u-v)/2.*sqrt(3.0);
  11. complex<double> a(r,im);
  12. cout<<a<<endl;
  13. cout<<-a<<endl;
  14. system("pause");
  15. return 0;
  16. }
Success #stdin #stdout #stderr 0s 3428KB
stdin
Standard input is empty
stdout
(0.5,-0.866025)
(-0.5,0.866025)
stderr
sh: pause: not found