fork(1) download
  1. #include <iostream>
  2. #include <complex>
  3.  
  4. int main()
  5. {
  6. using namespace std::complex_literals;
  7. std::complex<double> matrix[2][2] =
  8. {{ 1.0 + 0i, 0.0 + 1i},
  9. {-1.0 + 0i, 0.0 - 1i}};
  10. for(const auto& row: matrix) {
  11. for(const auto& c: row)
  12. std::cout << c << ' ';
  13. std::cout << '\n';
  14. }
  15. }
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
(1,0) (0,1) 
(-1,0) (0,-1)