linux下清空c++ cin无效流的方式

cin.clear();
cin.ignore(10000,'
');//这里面的参数很重要
原文地址:https://www.cnblogs.com/qiumingcheng/p/7826385.html