-
Notifications
You must be signed in to change notification settings - Fork 0
/
A.java
45 lines (41 loc) · 1.2 KB
/
A.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
40
41
42
43
44
45
package A;
import static java.util.Arrays.*;
import java.io.*;
import java.util.*;
public class A {
public static final String INPUT_FILE = "./src/A/a.in";
public static final String OUTPUT_FILE = "./src/A/a.out";
static boolean LOCAL = System.getSecurityManager() == null;
static boolean TO_FILE = true;
Scanner cin = new Scanner(System.in);
void run() {
while (cin.hasNext()){
int a = cin.nextInt();
int b = cin.nextInt();
if( a == 0 && b == 0)break;
if((a+b)%7==0)
System.out.println(7);
else System.out.println((a+b)%7);
}
}
public void debug(Object ... objects){
System.err.println(deepToString(objects));
}
public static void main(String[] args) {
if (LOCAL) {
try {
System.setIn(new FileInputStream(INPUT_FILE));
} catch (Throwable e) {
LOCAL = false;
}
}
if (TO_FILE) {
try {
System.setOut(new PrintStream(OUTPUT_FILE));
} catch (FileNotFoundException e) {
TO_FILE = false;
}
}
new A().run();
}
}