fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <set>
  4. using namespace std;
  5.  
  6. template<class T>
  7. void output(T &arr)
  8. {
  9. for (auto &&val : arr)
  10. {
  11. cout << val << endl;
  12. }
  13. };
  14.  
  15. int main() {
  16. vector<int> vec={1,2,3,4,5};
  17. set<int> set={6,7,8};
  18. output(vec);
  19. output(set);
  20. // your code goes here
  21. return 0;
  22. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
1
2
3
4
5
6
7
8