题目:

Trouble came from the overseas lands: a three-headed dragon Gorynych arrived. The dragon settled at point C and began to terrorize the residents of the surrounding villages.

A brave hero decided to put an end to the dragon. He moved from point A to fight with Gorynych. The hero rode from point A along a straight road and met point B on his way. The hero knows that in this land for every pair of roads it is true that they are either parallel to each other, or lie on a straight line, or are perpendicular to each other. He also knows well that points B and C are connected by a road. So the hero must either turn 90 degrees to the left or continue riding straight ahead or turn 90 degrees to the right. But he forgot where the point C is located.

Fortunately, a Brave Falcon flew right by. It can see all three points from the sky. The hero asked him what way to go to get to the dragon's lair.

If you have not got it, you are the falcon. Help the hero and tell him how to get him to point C: turn left, go straight or turn right.

At this moment the hero is believed to stand at point B, turning his back to point A.

Input

The first input line contains two space-separated integers xa, ya (|xa|, |ya| ≤ 109) — the coordinates of point A. The second line contains the coordinates of point B in the same form, the third line contains the coordinates of point C.

It is guaranteed that all points are pairwise different. It is also guaranteed that either point B lies on segment AC, or angle ABC is right.

Output

Print a single line. If a hero must turn left, print "LEFT" (without the quotes); If he must go straight ahead, print "TOWARDS" (without the quotes); if he should turn right, print "RIGHT" (without the quotes).

input
0 0
0 1
1 1
output
RIGHT
input
-1 -1
-3 -3
-4 -4
output
TOWARDS
input
-4 -6
-3 -7
-2 -6
 output
   LEFT
题意:有三个点A、B、C,给出他们坐标,从A走到B再到C,让你判断位于B点时,想要到C点是左转、右转还是直走。
用向量的叉积来做,还是挺简单的。

 1 #include <map>
2 #include <stack>
3 #include <queue>
4 #include <cmath>
5 #include <string>
6 #include <limits>
7 #include <cstdio>
8 #include <cstdlib>
9 #include <cstring>
10 #include <iostream>
11 #include <algorithm>
12 #define Scc(c) scanf("%c",&c)
13 #define Scs(s) scanf("%s",s)
14 #define Sci(x) scanf("%d",&x)
15 #define Sci2(x, y) scanf("%d%d",&x,&y)
16 #define Sci3(x, y, z) scanf("%d%d%d",&x,&y,&z)
17 #define Scl(x) scanf("%I64d",&x)
18 #define Scl2(x, y) scanf("%I64d%I64d",&x,&y)
19 #define Scl3(x, y, z) scanf("%I64d%I64d%I64d",&x,&y,&z)
20 #define Pri(x) printf("%d\n",x)
21 #define Prl(x) printf("%I64d\n",x)
22 #define Prc(c) printf("%c\n",c)
23 #define Prs(s) printf("%s\n",s)
24 #define For(i,x,y) for(int i=x;i<y;i++)
25 #define For_(i,x,y) for(int i=x;i<=y;i++)
26 #define FFor(i,x,y) for(int i=x;i>y;i--)
27 #define FFor_(i,x,y) for(int i=x;i>=y;i--)
28 #define Mem(f, x) memset(f,x,sizeof(f))
29 #define LL long long
30 #define ULL unsigned long long
31 #define MAXSIZE 1005
32 #define INF 0x3f3f3f3f
33 const int mod=1e9+7;
34 const double PI = acos(-1.0);
35
36 using namespace std;
37
38 int main()
39 {
40 LL x1,y1,x2,x3,y2,y3;
41 Scl2(x1,y1);
42 Scl2(x2,y2);
43 Scl2(x3,y3);
44 x1=x2-x1;
45 y1=y2-y1;
46 x2=x3-x2;
47 y2=y3-y2;
48 if(x1*y2-x2*y1>0)
49 Prs("LEFT");
50 else
51 if(x1*y2-x2*y1==0)
52 Prs("TOWARDS");
53 else
54 Prs("RIGHT");
55 return 0;
56 }

最新文章

  1. 如何使用JS来检测游览器是什么类型,或android是什么版本号- 转载
  2. Java入门记(三):初始化顺序
  3. strerror
  4. Java中List Set Map 是否有序等总结
  5. Maven Integration for Eclipse 正确地址
  6. 解决UITabeleViewCell的分割线不能铺满问题
  7. linux系统应用--Linux下用virtualBox安装win7(共享文件夹)
  8. bzoj 4373: 算术天才⑨与等差数列 hash
  9. 网络基础之 OSI七层模型
  10. [Swift]LeetCode174. 地下城游戏 | Dungeon Game
  11. postman工具的使用
  12. matlab画台风轨迹图小tip
  13. gitolite的部署
  14. python之路--FTP 上传视频示例
  15. hive的行列转换
  16. Android back键及backWebview模式跳转详解
  17. tplink-ssh登录
  18. linux安装anaconda3
  19. java实现邮箱验证的功能
  20. [转]OpenGL与CUDA互操作方式总结

热门文章

  1. #define 的神奇操作
  2. IOS移动端 -webkit-overflow-scrollin属性造成的问题
  3. npm设置
  4. input、print、字符串格式化输出
  5. PL/SQL Developer使用中文条件查询时无数据的解决方法
  6. django中只使用ModleForm的表单验证,而不使用ModleForm来渲染
  7. 2022年8月20,第一组,周鹏,从1到m中随机取n个数,n&lt;=m,显示出所有取法
  8. S2-032 CVE-2016-3081 远程代码执行
  9. Java入门及环境搭建
  10. [cocos2d-x]捕鱼达人炮台射击角度的旋转实现