fork(1) download
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. long long int factorial(long long int num) {
  6. if(num == 1 || num == 0) return 1;
  7. return num * factorial(num - 1);
  8. }
  9.  
  10. int main() {
  11. long long int M, N;
  12. while (scanf("%lli %lli", &M, &N) != EOF) cout << factorial(M) + factorial(N) << endl;
  13. }
  14.  
  15. //https://pt.stackoverflow.com/q/396814/101
Success #stdin #stdout 0s 15232KB
stdin
5
5
stdout
240