fork(11) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. count(3);
  6.  
  7. return 0;
  8. }
  9. void count(int n)
  10. {
  11. static int d=1;
  12. printf("%d ",n);
  13. printf("%d ",d);
  14. d++;
  15. if(n>1)count(n-1);
  16. printf("%d ",d);
  17. }
Success #stdin #stdout 0s 2160KB
stdin
Standard input is empty
stdout
3 1 2 2 1 3 4 4 4