fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. int count=0;
  4. void f(string name){
  5. if(count==3){
  6. cout<<name<<endl;
  7. count++;
  8. return;
  9. }
  10. cout<<name<<endl;
  11. count++;
  12. f(name);
  13. }
  14. int main() {
  15. // your code goes here
  16. f("Om");
  17. }
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
Om
Om
Om
Om