Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigInteger;
- class FinalModifierTest {
- public static void main(String[] args) {
- BigInteger good=BigInteger.valueOf(1);
- BigInteger s=BigInteger.valueOf(0);
- BigInteger m10=BigInteger.valueOf(10);
- for(int i=1; i<101; i++){
- BigInteger m=BigInteger.valueOf(i);
- good=good.multiply(m);
- }
- while(good.bitLength()>0)
- {
- s=s.add(good.mod(m10));
- good=good.divide(m10);
- }
- System.out.println(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment