Advertisement
Josif_tepe

Untitled

Oct 6th, 2021
130
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. #include <cmath>
  3. #include <algorithm>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. void print(int x) {
  8.     if(x > 100) {
  9.         return;
  10.     }
  11.    
  12.     cout << x << endl;
  13.     print(x + 1);
  14. }
  15. int main() {
  16.     print(1);
  17.     return 0;
  18. }
  19. // print(1)
  20. // ...
  21. // print(101) --> return
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement