Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int n = 7/2;
  10. vector<int> v;
  11.  
  12. for(int i = 0 ; i < 7 ; i++)
  13. v.emplace_back(i);
  14.  
  15.  
  16. for(int j=0; j < 7 ; ){
  17. cout << v[j] << " ";
  18. v.erase(remove(v.begin(),v.end(),j),v.end());
  19. j+=n;
  20. }
  21.  
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement