백준 #21756번 지우개

jhj·2025년 1월 18일

백준 JAVA

목록 보기
557/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int num = 1;
		
		while(n != 1) {
			n = n / 2;
			num = num * 2;
		}
		System.out.println(num);
		sc.close();
	}
}
profile
개발자를 꿈꾸는

0개의 댓글