fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int fun(int x){
  5. if (x>0){
  6. int ret = fun(x-1);
  7. cout << x << endl;
  8. return ret;
  9. }
  10. return 0;
  11. }
  12.  
  13. int main()
  14. {
  15. fun(3);
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
1
2
3