Created
July 4, 2019 23:53
-
-
Save camilojm27/4c6fed01e8a1428f890edd193ee4d41c to your computer and use it in GitHub Desktop.
This file contains 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
import java.io.IOException; | |
import java.math.BigInteger; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) throws IOException { | |
Scanner escanercito = new Scanner(System.in); | |
while (escanercito.hasNextInt()){ | |
int number1, number2; | |
number1 = escanercito.nextInt(); | |
number2 = escanercito.nextInt(); | |
System.out.println(bigSum(number1,number2)); | |
} | |
System.out.println(fac(7)); | |
} | |
public static BigInteger fac(int numero){ | |
if(numero == 0){ | |
return BigInteger.ONE; | |
} | |
return BigInteger.valueOf(numero).multiply(fac(numero - 1)); | |
} | |
public static BigInteger bigSum(int number1, int number2){ | |
BigInteger bigSum = fac(number1).add(fac(number2)); | |
return bigSum; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment