apl-mhd

setInVector

Aug 13th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. #include <vector>
  4. using namespace std;
  5.  
  6.  
  7. int main(int argc, char **argv)
  8. {
  9.     set<int>x;
  10.     set<int>m;
  11.     set<int>::iterator it;
  12.    
  13.     vector<set<int>>y[10];
  14.    
  15.    
  16.     x.insert(1);
  17.     x.insert(2);
  18.     x.insert(3);
  19.     x.insert(4);
  20.    
  21.     x.insert(1);
  22.     x.insert(2);
  23.     x.insert(4);
  24.     x.insert(5);
  25.    
  26.     y[0].push_back(x);
  27.    
  28.     m = y[0][0];
  29.    
  30.     for(it = m.begin(); it !=m.end(); it++){
  31.        
  32.         cout<<*it;
  33.         }
  34.    
  35.    
  36.    
  37.    
  38.     return 0;
  39. }
Add Comment
Please, Sign In to add comment