fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. vector<string> v;
  8.  
  9. for(string s; cin>>s; v.emplace_back(s));
  10.  
  11. for(const auto& item:v)
  12. cout << "word:" << item << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 4292KB
stdin
/hello    /world           /again
stdout
word:/hello
word:/world
word:/again