Advertisement
kokokozhina

stl_14

Apr 12th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. #include <set>
  5. #include <stdio.h>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. #ifdef _DEBUG
  12. freopen("input.txt", "r", stdin);
  13. freopen("output.txt", "w", stdout);
  14. #endif
  15. printf("Enter the number of elements in first vector and number of elements in second\n");
  16. int n, m;
  17. scanf("%d%d", &n, &m);
  18. vector<int> a(n);
  19. vector<int> b(m);
  20. printf("Now enter the value of elements in first vector\n");
  21. for(int i = 0; i < n; i++) scanf("%d", &a[i]);
  22. printf("Now enter the value of elements in second vector\n");
  23. for(int i = 0; i < m; i++) scanf("%d", &b[i]);
  24.  
  25. /*printf("\nNow enter the value of x(for multiplicity) and new element: ");
  26. int x, new_elem; scanf("%d%d", &x, &new_elem);
  27. for(auto it = a.begin(); it != a.end(); ++it)
  28. if(*it % x == 0 && *it % 2 == 0){
  29. a.insert(it, new_elem);
  30. ++it;
  31. }
  32. printf("\nAfter inserting new elements vector is: ");
  33. for(auto it = a.begin(); it != a.end(); ++it) printf("%d ", *it);
  34. */
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement