fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. int count=0;
  4. void f(int& n){
  5. if(n==4){
  6. cout<<n<<endl;
  7. n++;
  8. return;
  9. }
  10. cout<<n<<endl;
  11. n++;
  12. f(n);
  13. }
  14. int main() {
  15. int num=0;
  16. f(num);
  17. }
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
0
1
2
3
4