Browse Source

First one done

umar
Raphael Roberts 7 years ago
parent
commit
fbd1b2a9cf
  1. 19
      LargeIntegers.java

19
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);
}
}
Loading…
Cancel
Save