在这段代码中,如何停止这段代码的输入,在HUBBARD的早期版本中,它的写入使用Ctrl + D或Ctrl + z,但它不起作用。请帮助如何停止输入命令?
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char line[80];
while(*line)
{
cin>>line;
if(*line) cout<<" "<<line<<" "<<endl;
}
return 0;
}
通过输入'\ 0' –
你试过'按Ctrl + C'? –
\ 0不工作 是的,Ctrl + c正在工作。 谢谢 –