fork download
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::list<int> tempList;
  7. for (int i = 0; i < 10; ++i)
  8. tempList.push_back(i);
  9.  
  10. for (auto it = tempList.begin(); it != tempList.end(); ++it)
  11. cout << *it << endl;
  12. for (auto it = tempList.begin(); it != tempList.end(); ++it)
  13. cout << *it * 2 << endl;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
0
1
2
3
4
5
6
7
8
9
0
2
4
6
8
10
12
14
16
18