Josif_tepe

Untitled

Oct 1st, 2025
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <queue>
  2. #include <iostream>
  3. #include <vector>
  4. #include <cstring>
  5. #include <iostream>
  6. #include <set>
  7. #include <map>
  8. #include <cstring>
  9. //#include <bits/stdc++.h>
  10. using namespace std;
  11.  
  12. void broevi(int x) {
  13.     if(x > 5){
  14.         return;
  15.     }
  16.    
  17.     broevi(x + 1);
  18.     cout << x << " ";
  19. }
  20. int main() {
  21.     broevi(1);
  22.     return 0;
  23. }
  24. // broevi(1) --> broevi(2) | cout << 1 << " ";
  25. // broevi(2) --> broevi(3) | cout << 2 << " ";
  26. // broevi(3) --> broevi(4) | cout << 3 << " ";
  27. // broevi(4) --> broevi(5) | cout << 4 << " " ;
  28. // broevi(5) --> broevi(6) | cout << 5 << " ";
  29. // broevi(6)
  30.  
Advertisement
Add Comment
Please, Sign In to add comment