fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. long long fact(long long n) {
  5. if (n == 1) {
  6. return 1;
  7. }
  8. return n * fact(n - 1);
  9. }
  10.  
  11. int main() {
  12. int a, b;
  13. cin >> a >> b;
  14. int smaller = min(a, b);
  15. cout << fact(smaller);
  16. return 0;
  17. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty