fork(4) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. char plus{},img{};
  7. double x{},y{};
  8. cin>> x >> plus >> y >> img;
  9. if (plus!='+' || img!='i')
  10. cout << "\nError: "<< "x=" << x <<", plus=" << plus <<", y=" << y <<", img=" << img;
  11. else
  12. cout << "\nComplex: " << x << plus << y << img;
  13.  
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 3460KB
stdin
1e3+93E-2i
stdout
Complex: 1000+0.93i