fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define pb push_back
  5. #define yes cout<<"YES\n";
  6. #define no cout<<"NO\n";
  7. const int N=3e5+7;
  8. ll T=1;
  9. ll x;
  10. ll rec(ll n)
  11. {
  12. if(n == 1)
  13. return 1;
  14.  
  15. return n * rec(n - 1);
  16. }
  17.  
  18. int main()
  19. {
  20. cin >> x;
  21. cout << rec(x);
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5276KB
stdin
5
stdout
120