iscsi

java ideone

Jan 17th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. import java.math.BigInteger;
  2.  
  3. class FinalModifierTest {
  4.         public static void main(String[] args) {
  5.         BigInteger good=BigInteger.valueOf(1);
  6.         BigInteger s=BigInteger.valueOf(0);
  7.         BigInteger m10=BigInteger.valueOf(10);
  8.  
  9.         for(int i=1; i<101; i++){
  10.                 BigInteger m=BigInteger.valueOf(i);
  11.               good=good.multiply(m);
  12.          }
  13.         while(good.bitLength()>0)
  14.         {
  15.                 s=s.add(good.mod(m10));
  16.                 good=good.divide(m10);
  17.         }
  18.         System.out.println(s);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment