fork download
  1. #include <cstdlib>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <list>
  5. #include<iostream>
  6.  
  7. using namespace std;
  8.  
  9. int main(int argc, char** argv) {
  10.  
  11. list<int> *adjV = new list<int>[3];
  12.  
  13. adjV[0].push_back(10);
  14. adjV[0].push_front(20);
  15. adjV[0].push_back(30);
  16.  
  17. adjV[1].push_back(45);
  18. adjV[1].push_front(55);
  19. adjV[1].push_back(65);
  20.  
  21. adjV[2].push_back(80);
  22. adjV[2].push_front(90);
  23. adjV[2].push_back(100);
  24.  
  25. for(int i = 0; i < 3; ++i) {
  26. for (list<int>::iterator it = adjV[i].begin(); it!= adjV[i].end(); ++it){
  27. cout<<*it<<endl;
  28. }
  29. }
  30.  
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0s 4496KB
stdin
Standard input is empty
stdout
20
10
30
55
45
65
90
80
100