Advertisement
myloyo

8.3-3

Mar 2nd, 2023 (edited)
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. void f(int n) {
  6.     if (n != 0) {
  7.         f(n - 1);
  8.         cout << n << " ";
  9.     }
  10.  
  11. }
  12. int main() {
  13.     int n;
  14.     cin >> n;
  15.     f(n);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement