HDACM 2502
找规律
import java.util.Scanner;public class Main {public static void main(String[] args) {int moonNum[] = new int[21];moonNum[1] = 1;for (int i = 2; i < moonNum.length; i++) {moonNum[i] = moonNum[i-1]*2+(int)Math.pow(2, i-2);}Scanner sc = new Scanner(System.in);int t = sc.nextInt();while(t-->0){int n = sc.nextInt();System.out.println(moonNum[n]);}sc.close();}
}