| 1 |
void abort (void); |
| 2 |
void exit (int); |
| 3 |
|
| 4 |
typedef struct { |
| 5 |
long int p_x, p_y; |
| 6 |
} Point; |
| 7 |
|
| 8 |
int |
| 9 |
f (Point basePt, Point pt1, Point pt2) |
| 10 |
{ |
| 11 |
long long vector; |
| 12 |
|
| 13 |
vector = |
| 14 |
(long long) (pt1.p_x - basePt.p_x) * (long long) (pt2.p_y - basePt.p_y) - |
| 15 |
(long long) (pt1.p_y - basePt.p_y) * (long long) (pt2.p_x - basePt.p_x); |
| 16 |
|
| 17 |
if (vector > (long long) 0) |
| 18 |
return 0; |
| 19 |
else if (vector < (long long) 0) |
| 20 |
return 1; |
| 21 |
else |
| 22 |
return 2; |
| 23 |
} |
| 24 |
|
| 25 |
int |
| 26 |
main (void) |
| 27 |
{ |
| 28 |
Point b, p1, p2; |
| 29 |
int answer; |
| 30 |
|
| 31 |
b.p_x = -23250; |
| 32 |
b.p_y = 23250; |
| 33 |
|
| 34 |
p1.p_x = 23250; |
| 35 |
p1.p_y = -23250; |
| 36 |
|
| 37 |
p2.p_x = -23250; |
| 38 |
p2.p_y = -23250; |
| 39 |
|
| 40 |
answer = f (b, p1, p2); |
| 41 |
|
| 42 |
if (answer != 1) |
| 43 |
abort (); |
| 44 |
exit (0); |
| 45 |
} |