头文件#include 判断方法 while(1) { // check input if (_kbhit()) { break; } // do something cout << "aaaa" << endl; }