cout<<"please enter real:"; while(!(cin>>inputdata)) { cin.clear(); while(cin.get()!='\n') {continue;} cout<<"please enter real again:"; }; real = inputdata;
cout<<"please enter imag:"; while(!(cin>>inputdata)) { cin.clear(); while(cin.get()!='\n') {continue;} cout<<"please enter real aggin:"; }; imag = inputdata;