Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Created January 18, 2015 23:08
Show Gist options
  • Save joffilyfe/f6b242bf0716f15d044b to your computer and use it in GitHub Desktop.
Save joffilyfe/f6b242bf0716f15d044b to your computer and use it in GitHub Desktop.
#include <stdio.h>
long long int fazFatorial(long long int numero);
int main(void) {
int numero;
int x, y;
long long int sum = 0;
while (scanf("%d %d", &x, &y) != EOF) {
sum += fazFatorial(x) + fazFatorial(y);
printf("%lld\n", sum);
sum = 0;
}
return 0;
}
long long int fazFatorial(long long int numero) {
int i = 0;
if (numero != 0) {
for (i = numero; i > 1; i--) {
numero *= i - 1;
}
} else {
numero++;
}
return numero;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment