fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. void func2(int n){
  5. if(n==0) return;
  6. func2(n-1);
  7. cout<< n << endl;
  8. }
  9.  
  10. int main() {
  11. int n;
  12. cin >> n;
  13. func2(n);
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5300KB
stdin
5
stdout
1
2
3
4
5