AlenAntonelli

MONSTRUO

Jun 2nd, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <utility>
  4. using namespace std;
  5.  
  6. struct casa {
  7.     vector< pair<int, casa> > v;
  8. };
  9.  
  10. int main()
  11. {
  12.     casa x;
  13.     x.v.resize(2);
  14.     x.v[0].first=1;
  15.     x.v[0].second.v.resize(1);
  16.     x.v[0].second.v[0].first=2;
  17.     x.v[0].second.v[0].second.v.resize(1);
  18.     x.v[0].second.v[0].second.v[0].first=3;
  19.    
  20.     cout<<x.v[0].first<<endl;
  21.     cout<<x.v[0].second.v[0].first<<endl;
  22.     cout<<x.v[0].second.v[0].second.v[0].first<<endl;
  23.    
  24.    
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment