fork download
  1.  
  2. import java.util.*;
  3. import java.lang.*;
  4. import java.io.*;
  5.  
  6. import java.math.BigInteger;
  7.  
  8.  
  9. class Ideone
  10. {
  11. public static BigInteger pow_2 (int n)
  12. {
  13. String binary = "1";
  14. for (int i=0; i<n; i++) binary += "0";
  15. return new BigInteger(binary, 2);
  16. }
  17.  
  18. public static void main (String[] args) throws java.lang.Exception
  19. {
  20. System.out.println(pow_2(10).toString());
  21. }
  22. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
1024