Created
August 28, 2016 14:55
-
-
Save washingtonsoares/10b8d7bbf958600fb7785679d10b6d7f 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
package p_1161; | |
import java.io.IOException; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String args[]) throws IOException { | |
Scanner sc = new Scanner(System.in); | |
int nro1, nro2; | |
nro1 = sc.nextInt(); | |
nro2 = sc.nextInt(); | |
long result1 = makeFatorial(nro1); | |
long result2 = makeFatorial(nro2); | |
long result = result1+result2; | |
System.out.printf("%d", result); | |
} | |
static long makeFatorial(int nro){ | |
long fat=1l; | |
for(int i=1;i<=nro;i++){ | |
fat *= i; | |
} | |
return fat; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment