在這段代碼中,如何停止這段代碼的輸入,在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正在工作。 謝謝 –