fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <iostream>
  4. #include <complex>
  5. using namespace std;
  6.  
  7. int main() {
  8. // your code goes here
  9. std::vector<std::complex<double>> vec1 { std::complex<double>(1., 2.),
  10. std::complex<double>(3., 4.) };
  11. printf("%f %f\n", vec1[0].real(), vec1[0].imag());
  12. printf("%f %f\n", vec1[1].real(), vec1[1].imag());
  13. return 0;
  14. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
1.000000 2.000000
3.000000 4.000000