fork download
  1. #include <iostream>
  2. #include <list>
  3. using namespace std;
  4.  
  5. typedef list<int> IntegerList;
  6.  
  7. int main()
  8. {
  9. IntegerList intList;
  10. for (int i=1; i<=10; ++i)
  11. intList.push_back(i * 2);
  12. for (int i : intList)
  13. cout << i << " ";
  14. }
  15.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
2 4 6 8 10 12 14 16 18 20