Advertisement
Egonau

1.6-3

Jan 7th, 2023
987
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. import java.math.BigInteger;
  2. import java.util.Scanner;
  3.  
  4. public class Main {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         int num = scanner.nextInt();
  9.         BigInteger two = BigInteger.TWO;
  10.         for (int i = 1;i<num;++i){ two = two.multiply(BigInteger.TWO); }
  11.         two = two.subtract(BigInteger.ONE);
  12.         System.out.println(two);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement