[JAVA] 정수 2개를 입력받아 2의 거듭제곱 배로 출력하기
a 를 2b배 만큼 곱한 값을 출력한다. import java.io.IOException; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int pow = (int) Math.pow(2, b); System.out.println(a*pow); } }