-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImplement2.java
More file actions
31 lines (28 loc) · 895 Bytes
/
Copy pathImplement2.java
File metadata and controls
31 lines (28 loc) · 895 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 dataStructure;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Implement2 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int cnt = 0;
for (int i = 0; i <= n; i++) {
for (int j = 0; j < 60; j++) {
for (int k = 0; k < 60; k++) {
if (check(i, j, k)) {
cnt++;
}
}
}
}
System.out.println(cnt);
}
private static boolean check(int i, int j, int k) {
if (i % 10 == 3 || j / 10 == 3 || j % 10 == 3 || k / 10 == 3 || k % 10 == 3) {
return true;
} else {
return false;
}
}
}