fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. long long factorial (int a) {
  6. if (a == 0)
  7. return 1;
  8. else
  9. return a*factorial(a - 1);
  10. }
  11.  
  12. int main() {
  13. long long n;
  14. int a;
  15. cin >> n;
  16. cout << factorial(n);
  17. return 0;
  18. }
Success #stdin #stdout 0s 4396KB
stdin
20
stdout
2432902008176640000