lil_kiddie

Задание по программированию: Перемещение строк

Nov 30th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. void MoveStrings(vector<string> source, vector<string>& destination)
  8. {
  9. for (int i = 0; i < source.size(); i++)
  10. destination.push_back(source[i]);
  11. source.clear();
  12. }
  13. int main() {
  14. vector<string> a = {"a", "h"};
  15. vector<string> b = {"y", "a"};
  16. MoveStrings(a, b);
  17. for (auto x : b)
  18. cout << x << " ";
  19.  
  20. return 0;
  21. }
Add Comment
Please, Sign In to add comment