import java.math.BigInteger;
public class Factorial {
public static BigInteger bigInteger(int n) {
BigInteger result = new BigInteger("1");
if (n < 0) {
System.err.println("n must be great than 0");
return new BigInteger("-1");
} else if (n == 0) {
return new BigInteger("1");
} else {
for (int i = 1; i <= n; i++) {
BigInteger num = new BigInteger(String.valueOf(i));
result = result.multiply(num);
}
return result;
}
}
public static void main(String[] args) {
System.out.println("result = " + bigInteger(100));
}
}