Advertisement
Josif_tepe

Untitled

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