#include <iostream> #include "conio.h" using namespace std; int main() { while (true) { // 在此处填入需要循环的代码 cout<<"hello"<<endl; if (_kbhit()) // 如果有按键被按下 { if (_getch() == ' ') { break; } } } return 0; }