fork(11) download
  1. #include <stdio.h>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. vector<int> A;
  7.  
  8. int rec(int idx){
  9. int i = A.size();
  10. A.push_back(0);
  11. if (idx >= 1000) return i;
  12. A[i] = rec(idx+1);
  13. return i;
  14. }
  15.  
  16. int main(){
  17. A.clear();
  18. rec(0);
  19. printf("A :");
  20. for (int i=0; i<5 && i<A.size(); i++)
  21. printf(" %d",A[i]);
  22. puts("");
  23. fflush(stdout);
  24. }
  25.  
  26.  
Runtime error #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
A : 0 0 0 0 0