Cpp_Primer_Practice icon indicating copy to clipboard operation
Cpp_Primer_Practice copied to clipboard

练习3.17 cin死循环

Open maaayz87 opened this issue 1 year ago • 1 comments

    while (cin >> s) { 
        words.push_back(s);
    }

敲击多个空格分割的单词回车后,这些单词都被写入了vector,但循环出不来。 我的方法: while (cin >> s && s!=“end”) { words.push_back(s); }再进行下步操作

是我的理解有问题吗,原题解运行不了。

maaayz87 avatar Jul 17 '24 09:07 maaayz87

题解代码换行没用,要手敲\n才能出循环

maaayz87 avatar Jul 17 '24 09:07 maaayz87