rdstate成员函数返回一个iostate类型的值,该值对应于流当前的整个状态条件
istream::iostate old_state = cin.rdstate();
cin.clear();
process_input();//use cin
cin.clear(old_state);
istream::iostate old_state = cin.rdstate();
cin.clear();
process_input();//use cin
cin.clear(old_state);