Skip to content

Commit f59d521

Browse files
authored
[20250928] BOJ / G5 / CCW / 이인희
1 parent 5f3a047 commit f59d521

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

LiiNi-coder/202509/28 BOJ CCW.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
```java
2+
import java.io.*;
3+
import java.util.*;
4+
5+
public class Main {
6+
public static void main(String[] args) throws IOException {
7+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8+
StringTokenizer st;
9+
10+
st = new StringTokenizer(br.readLine());
11+
long x1 = Long.parseLong(st.nextToken());
12+
long y1 = Long.parseLong(st.nextToken());
13+
14+
st = new StringTokenizer(br.readLine());
15+
long x2 = Long.parseLong(st.nextToken());
16+
long y2 = Long.parseLong(st.nextToken());
17+
18+
st = new StringTokenizer(br.readLine());
19+
long x3 = Long.parseLong(st.nextToken());
20+
long y3 = Long.parseLong(st.nextToken());
21+
22+
long value = (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1); // 외적
23+
if(value > 0) {
24+
System.out.println(1);
25+
}else if(value < 0) {
26+
System.out.println(-1);
27+
}else{
28+
System.out.println(0);
29+
}
30+
}
31+
}
32+
```

0 commit comments

Comments
 (0)