Advertisement
Psycho_Coder

Untitled

Aug 6th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. import java.math.BigInteger;
  2.  
  3. /**
  4.  *
  5.  * @author psychocoder
  6.  */
  7. public class BigPrime {
  8.    
  9.     public static void main(String[] args) {
  10.         String m = BigInteger.ONE.shiftLeft(1000).toString();
  11.         int i=0,sum=0;
  12.         while(i<m.length()){
  13.             sum = sum + m.charAt(i) - '0';
  14.             i++;
  15.         }
  16.         System.out.println(sum);
  17.     }    
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement