BAEKJOON, 코딩테스트 관련
1436번 영화감독 숌 - JAVA (브루트 포스)
구름이팡팡
2022. 10. 7. 15:04
728x90
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int num = 666;
int count = 1;
while(count != n) {
num++;
if(String.valueOf(num).contains("666")) {
count++;
}
}
System.out.println(num);
}
}
* 체크할점
- 브루트 포스 (brute force) : 무차별 대입
728x90