You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
501 B

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);
}
}