fork download
  1. #include <iostream>
  2. //irving alexander rodriguez carbajal
  3. using namespace std;
  4.  
  5.  
  6. long long factorial(int n){
  7. if (n==1 || n == 0) return 1;
  8. else return n*factorial(n-1);
  9. }
  10.  
  11. int main()
  12. {
  13. int n;
  14. long long res;
  15. cin >> n;
  16. res = factorial(n);
  17. cout << res << endl;
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
0