Skip to content

Instantly share code, notes, and snippets.

@washingtonsoares
Created August 28, 2016 14:55
Show Gist options
  • Save washingtonsoares/10b8d7bbf958600fb7785679d10b6d7f to your computer and use it in GitHub Desktop.
Save washingtonsoares/10b8d7bbf958600fb7785679d10b6d7f to your computer and use it in GitHub Desktop.
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