fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <iterator>
  4.  
  5. #include <list>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. list<int> coll{ 1, 2, 3, 4, 5 };
  12.  
  13. copy(coll.begin(), coll.end(), ostream_iterator<int>(cout, " "));
  14. cout << endl;
  15.  
  16. copy(coll.begin(), coll.end(), back_inserter(coll));
  17.  
  18. copy(coll.begin(), coll.end(), ostream_iterator<int>(cout, " "));
  19. cout << endl;
  20. }
Time limit exceeded #stdin #stdout 5s 998912KB
stdin
Standard input is empty
stdout
1 2 3 4 5