Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include<vector>
  2. #include<iostream>
  3. #include<string>
  4. #include<sstream>
  5. using namespace std;
  6. void process_vector(vector<string>&);
  7.  
  8. int main()
  9. {
  10.     string str, word;
  11.     getline(cin, str);
  12.     stringstream ss(str);
  13.     vector<string> vs;
  14.     while (ss >> word)
  15.     {
  16.         vs.push_back(word);
  17.     }
  18.     process_vector(vs);
  19.     for (auto word : vs)
  20.     {
  21.         cout << word << " ";
  22.     }
  23.     return 0;
  24. }
  25.  
  26. void process_vector(vector<string>& vs)
  27. {
  28.     // как-нибудь обрабатываем вектор:
  29.     for (auto &word : vs)
  30.     {
  31.         for (auto &ch : word)
  32.         {
  33.             ch++;
  34.         }
  35.     }
  36.    
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement