Advertisement
Josif_tepe

Untitled

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