-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp1926.java
39 lines (31 loc) · 1.02 KB
/
p1926.java
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
32
33
34
35
36
37
38
39
package self.samsungExpert;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
// platform | SWEA
// number | 1926
// title | 간단한 369게임
// level | D3
// how |
// etc |
// result |
public class p1926 {
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=1; i<=N; i++) {
String tmp = String.valueOf(i);
if (tmp.contains("3") || tmp.contains("6") || tmp.contains("9")) {
for (int j = 0; j < tmp.length(); j++) {
if (tmp.charAt(j) == '3' || tmp.charAt(j) == '6' || tmp.charAt(j) == '9') {
System.out.print("-");
}
}
System.out.print(" ");
} else {
System.out.print(i + " ");
}
}
}
}