fork(6) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int fun(int n) {
  5.  
  6. int x=1, k;
  7. if (n==1) return x;
  8. for (k=1; k<n; ++k)
  9. x = x + fun(k) *fun (n-k);
  10. return x;
  11. }
  12.  
  13. int main() {
  14. cout<<fun(5);
  15. return 0;
  16. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
51