fork download
  1. #include <iostream>
  2. using namespace std;
  3. void helper(int n){
  4. if(n==0)return;
  5. cout<<"r:"<<n<<endl;
  6. helper(n-1);
  7. cout<<n<<endl;
  8. }
  9. int main() {
  10. int n ;
  11. cin>>n;
  12. helper(n);
  13. }
Success #stdin #stdout 0s 5280KB
stdin
5
stdout
r:5
r:4
r:3
r:2
r:1
1
2
3
4
5