Advertisement
Josif_tepe

Untitled

Mar 27th, 2022
809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <queue>
  3. #include <algorithm>
  4. #include <vector>
  5. #include <algorithm>
  6. #include <set>
  7. #include <cstring>
  8. #include <cmath>
  9. #include <map>
  10. #include <fstream>
  11. using namespace std;
  12.  
  13. void f(int x) {
  14.     if(x > 10) {
  15.         return;
  16.     }
  17.     cout << x << " ";
  18.     f(x + 1);
  19. }
  20. int main() {
  21.  
  22.     f(1);
  23.    return 0;
  24. }
  25. /*
  26.  f(1) --> f(2)
  27.  f(2) --> f(3)
  28.  f(3) --> f(4)
  29.  f(4) --> f(5)
  30.  f(5) --> f(6)
  31.  f(6) --> f(7)
  32.  f(7) --> f(8)
  33.  f(8) --> f(9)
  34.  f(9) --> f(10)
  35.  f(10) --> f(11)
  36.  f(11) return
  37.  
  38.  */
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement