#include <iostream>
#include <list>
#include <algorithm>
using std::list;
using std::cout;
using std::endl;
void print(int n) {
cout << n << " ";
}
int main()
{
list<int> lst1{ 13, 12, 300, 1, 98 }, lst2(5);
copy(lst1.begin(), lst1.end(), lst2.begin());
for_each(lst2.begin(), lst2.end(), print);
cout << endl;
return 0;
}
/*
run:
13 12 300 1 98
*/