Created
January 18, 2015 23:08
-
-
Save joffilyfe/f6b242bf0716f15d044b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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