L1-012 计算指数 import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int sum=1; for(int i=1;i<=a;i++){ sum*=2; } System.out.println("2^"+a+" = "+sum); } }