Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. //Сейчас исправлю
  2. #include <iostream>
  3. #include <string>
  4. #include <math.h>
  5.  
  6. using namespace std;
  7.  
  8. int f(int a)
  9. {
  10. if (a==0 || a==1)
  11. {
  12. return 1;
  13. }
  14.  
  15. else
  16. {
  17. return f(a)*f(a-1);
  18. }
  19. }
  20.  
  21. int main()
  22. {
  23. int a;
  24. cout << "Enter A:";
  25. cin >> a;
  26. cout << f(a);
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement