Advertisement
Josif_tepe

Untitled

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