fork download
  1. #include <stdio.h>
  2.  
  3. int f( int x )
  4. {
  5. if (x == 1) return 1;
  6. int val = f(x-1);
  7. return val * ( val + 1 ) * ( val + 1 );
  8. //jak ja tego nie lubie, to jest oczywiscie zle
  9. }
  10. /*taki ciag, 2 ciąg
  11. x1 = 1
  12. x2 = 1 * 2^2 = 4
  13. x3 = 4 * 25
  14. kolejny wyraz powstaje poprzez = wyraz poprzedni * (wyraz poprzedni +1)^2
  15. */
  16.  
  17. int main(int argc, char* argv[])
  18. {
  19.  
  20. printf("%d", f(2));
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
4