Advertisement
Josif_tepe

Untitled

Jan 12th, 2023
623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <queue>
  4. using namespace std;
  5.  
  6. void rec(int number) {
  7.     if(number > 5) {
  8.         return;
  9.     }
  10.     cout << number << endl;
  11.     rec(number + 1);
  12. }
  13.  
  14. int main() {
  15.    
  16.     rec(1);
  17.     return 0;
  18. }
  19. // rec(1) --> rec(2)
  20. // rec(2) --> rec(3)
  21. // rec(3) --> rec(4)
  22. // rec(4) --> rec(5)
  23. // rec(5) --> rec(6)
  24. // rec(6)
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement