fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void out(int n, int curr = 0)
  6. {
  7. if (n < curr) return;
  8. cout << curr << endl;
  9. out(n,curr+1);
  10. }
  11.  
  12.  
  13. int main(int argc, const char * argv[])
  14. {
  15. int m, M;
  16. cout << "From: "; cin >> m;
  17. cout << "To : "; cin >> M;
  18.  
  19. out(M,m);
  20. }
  21.  
Success #stdin #stdout 0s 15232KB
stdin
2 10
stdout
From: To  : 2
3
4
5
6
7
8
9
10