Advertisement
Josif_tepe

Untitled

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