본문 바로가기
휴지통/알고리즘 & 자료구조

백준 1436

by 신재권 2022. 2. 25.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main1436 {


	
	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		
		
		for(int i=666;;i++) {
			String s = i+"";
			if(s.contains("666")) {
				N--;
			}
			if(N == 0) {
				System.out.println(i);
				break;
			}
		}
		
	}
	
	
	

	
	
}

 

'휴지통 > 알고리즘 & 자료구조' 카테고리의 다른 글

백준 4949  (0) 2022.02.27
백준 9012_1  (0) 2022.02.26
백준 2852  (0) 2022.02.24
백준 3474  (0) 2022.02.23
백준 10709  (0) 2022.02.22