int main() { string line,b; getline(cin,line); stringstream ss(line); while(ss>>b) { cout<<b<<endl; } }
int main() { string s; while(getline(cin,s,'#')) //默認換行爲enter,這裏重載成# cout<<s<<"$"; }