fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <list>
  4. using namespace std;
  5.  
  6. int main() {
  7. ::vector<int> v = {1,2,3,4};
  8. ::list <int> l = {1,2,3,4};
  9. for (int n : v) {
  10. ::cout << n << '\n';
  11. }
  12. for (int n : l) {
  13. ::cout << n << '\n';
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 4352KB
stdin
Standard input is empty
stdout
1
2
3
4
1
2
3
4