/
BOJ_9288.java
27 lines (25 loc) · 896 Bytes
/
BOJ_9288.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
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
private void solution() throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= n; i++) {
int cur = Integer.parseInt(br.readLine());
sb.append(String.format("Case %d:\n", i));
for (int a = 1; a <= 6; a++) {
for (int b = a; b <= 6; b++) {
if (a+b == cur) {
sb.append(String.format("(%d,%d)\n", a, b));
}
}
}
}
System.out.println(sb);
}
public static void main(String[] args) throws Exception {
new Main().solution();
}
}