template <class X, class XCharType, class XTraits>
basic_istream<XCharType, XTraits>& operator>>(basic_istream<XCharType, XTraits>& qrInStream,
complex<X>& qrZ);#include <complex>
#include <complex>
#include <iostream>
int main()
{
using namespace std;
// Request input three times for complex numbers
complex<double> qZ;
for (int i = 0; i < 3; ++i) {
cout << "Input a complex number: ";
cin >> qZ;
cout << "The number is " << qZ << endl;
}
// Keep the window open
cin.clear();
cin.ignore(0xFFFFFFFF, '\n');
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.