string s;
while (getline(cin, s)) {
s += '\n';
for(auto c:s){
if (c == ' ')
cout << "yeah!space." << endl;
if (c == '\t')
cout << "yeah!tab." << endl;
if (c == '\n')
cout << "yeah!newline." << endl;
}
}
我感觉可能有问题。