-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcetvrta.java
52 lines (41 loc) · 1.13 KB
/
cetvrta.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
46
47
48
49
50
51
52
package cetvrta;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class cetvrta {
private void run() throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out));
int[] xVal = new int[3];
int[] yVal = new int[3];
for (int i = 0; i < 3; i++) {
StringTokenizer s = new StringTokenizer(r.readLine());
xVal[i] = Integer.parseInt(s.nextToken());
yVal[i] = Integer.parseInt(s.nextToken());
}
int x = 0;
int y = 0;
if (xVal[0] == xVal[1]) {
x = xVal[2];
} else if (xVal[1] == xVal[2]) {
x = xVal[0];
} else {
x = xVal[1];
}
if (yVal[0] == yVal[1]) {
y = yVal[2];
} else if (yVal[1] == yVal[2]) {
y = yVal[0];
} else {
y = yVal[1];
}
w.write(x + " " + y + "\n");
w.flush();
}
public static void main(String[] a) throws IOException {
(new cetvrta()).run();
}
}