fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. void vctrInhlt(vector<int>::iterator from, vector<int>::iterator to)
  7. {
  8. cout << *from << endl;
  9. if (from != to)
  10. {
  11. vctrInhlt(from + 1, to);
  12. }
  13. }
  14.  
  15.  
  16. int main()
  17. {
  18. vector<int> vec = {0, 1, 2, 3, 4, 5, 6};
  19. vctrInhlt(vec.begin(), vec.end());
  20. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
0
1
2
3
4
5
6
132569