Advertisement
j33vansh

Question 3 Chef Cooks Java Solution

Apr 30th, 2022
40
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.util.*;
  2. class Chefcooks{
  3.     public static void main(String[] args) {
  4.         Scanner sc = new Scanner(System.in);
  5.  
  6.         int t = sc.nextInt();
  7.         while (t-- > 0) {
  8.             int l = sc.nextInt();
  9.             long result = (long) Math.pow(2, l);
  10.             result--;
  11.             System.out.println(result);
  12.         }
  13.         sc.close();
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement