Algorithm/BOJ
[BOJ] 영화감독 숌
goakgoak
2020. 8. 27. 01:11
[1436] 영화감독 숌
https://www.acmicpc.net/problem/1436
소스코드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
static int n;
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
int num = 0;
while (N > 0) {
num++;
String s = String.valueOf(num);
if(s.contains("666")) N--;
}
System.out.println(num);
}
}
|
cs |