#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;
}
这个程序死循环,怎样改进让它正常推出。
...全文
259打赏收藏
c++primer上一段程序该如何改进好!
#include #include int main() { string word; while ( cin >> word ) cout ≪ "word read is: " ≪ word ≪ '\n'; cout ≪ "ok: no more words to read: bye!\n"; return 0; } 这个程序死循环,怎样改进让它正常推出。