请教C++问题
#include <iostream>
#include <string>
int main()
{string word;
while(cin >> word)
cout << "word read is:" << word << '\n';
cout << "ok: no more words to read:bye!\n";
return 0;
}
C++primer P16
书上讲的是输入riverrun, past eve and adam's
输出
word read is :riverrun,
word read is :past
word read is :eve
word read is :and
word read is :adam's
word read is :ok :no more words to read :bye!
本人用dev c++编译运行为什么没输出最后一行,而且程序并没有结束,重新等待输入新的字符