Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <utility>
- using namespace std;
- struct macumba {
- vector< pair<int, macumba> > v;
- }mak;
- void recorrer (macumba &padre, int n)
- {
- cout<<padre.v[0].first<<endl;
- macumba hijo = padre.v[0].second;
- if (n-1>0)
- recorrer(hijo,n-1);
- }
- int main()
- {
- mak.v.resize(1);
- mak.v[0].second.v.resize(1);
- mak.v[0].second.v[0].second.v.resize(1);
- mak.v[0].second.v[0].second.v[0].second.v.resize(1);
- mak.v[0].first=3;
- mak.v[0].second.v[0].first=2;
- mak.v[0].second.v[0].second.v[0].first=1;
- recorrer(mak,3);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment