forked from sowon-dev/AlgorithmStudy_Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_1436.java
More file actions
31 lines (28 loc) ยท 683 Bytes
/
_1436.java
File metadata and controls
31 lines (28 loc) ยท 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package backjoon;
// https://www.acmicpc.net/problem/1436
// ์ํ๊ฐ๋
์
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class _1436 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
// memory 158540 runtime 340
int num = 666; // 666์ด ์ฒซ ์ํ์์์ด๋๊น
int cnt = 1; // ๋ช๋ฒ์งธ ์ํ์ธ์ง
while(N != cnt){
num++;
if(String.valueOf(num).contains("666")) {
cnt++;
}
}
System.out.println(num);
}
}
/*
input
2
output
1666
*/