22921 [Java] 백준 2292번 : 벌집 import java.util.Scanner; public class Main { public static void main(String[] args) { // 6 + 12 + 18 + 24 ... Scanner in = new Scanner(System.in); int num = in.nextInt(); int sum = 1; int count = 1; while(sum < num) { sum += count++*6; } System.out.println(count); } } 2019. 8. 21. 이전 1 다음