From fbd1b2a9cfa0cfbe1ddfc0da50791297d39df1d8 Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Fri, 19 Oct 2018 20:28:37 -0500 Subject: [PATCH] First one done --- LargeIntegers.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 LargeIntegers.java 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