fork(1) download
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. list<list<int>> ListaList;
  8. for(int y=1;y<10;++y)
  9. {
  10. list<int> row;
  11. for(int x=0;x<y;++x) row.push_back(10*y+x+1);
  12. ListaList.push_back(row);
  13. }
  14. for(list<list<int>>::iterator y=ListaList.begin();y!=ListaList.end();++y)
  15. {
  16. for(list<int>::iterator x=y->begin();x!=y->end();++x) cout<<' '<<*x;
  17. cout<<endl;
  18. }
  19. cout<<endl;
  20. for(auto const &y:ListaList)
  21. {
  22. for(auto const &x:y) cout<<' '<<x;
  23. cout<<endl;
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
 11
 21 22
 31 32 33
 41 42 43 44
 51 52 53 54 55
 61 62 63 64 65 66
 71 72 73 74 75 76 77
 81 82 83 84 85 86 87 88
 91 92 93 94 95 96 97 98 99

 11
 21 22
 31 32 33
 41 42 43 44
 51 52 53 54 55
 61 62 63 64 65 66
 71 72 73 74 75 76 77
 81 82 83 84 85 86 87 88
 91 92 93 94 95 96 97 98 99