Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

练习3.17 cin死循环 #73

Open
maaayz87 opened this issue Jul 17, 2024 · 1 comment
Open

练习3.17 cin死循环 #73

maaayz87 opened this issue Jul 17, 2024 · 1 comment

Comments

@maaayz87
Copy link

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

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

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

@maaayz87
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant