fork download
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. list<int> l;
  8. l.push_back(1);
  9. l.push_back(2);
  10.  
  11. l.insert(l.end(), l.begin(), l.end());
  12.  
  13. for(list<int>::const_iterator it = l.begin();
  14. it != l.end(); ++it)
  15. {
  16. cout << *it;
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
1212