参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int amount = 1; for(int i = 1; i < n; i++) { amount = 2 * (amount + 1); } System.out.print(amount); } }
0.0分
0 人评分