diff --git a/LargeIntegers.java b/LargeIntegers.java new file mode 100644 index 0000000..2e66610 --- /dev/null +++ b/LargeIntegers.java @@ -0,0 +1,19 @@ +import java.math.BigInteger; +public class LargeIntegers { + public void oneOfThree( BigInteger a, BigInteger b, BigInteger c ){ + BigInteger res; + BigInteger TWO = new BigInteger("2"); + if (a.compareTo(b) == 0){ + res = a.multiply(b).multiply(c); + } + else { + if (c.mod(TWO).compareTo(BigInteger.ZERO) == 0) { + res = a.min(b); + } + else { + res = a.max(b); + } + } + System.out.println("Output: " + res); + } +} \ No newline at end of file