Advertisement
Josif_tepe

Untitled

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