codeforces题目,用python写
本题输入三个点坐标,考察叉积,若大于0则right,小于0则left,等于0则towards
代码:
a = raw_input().split()b = raw_input().split()c = raw_input().split()xa = int(a[0])ya = int(a[1])xb = int(b[0])yb = int(b[1])xc = int(c[0])yc = int(c[1])x1 = xb - xax2 = xb - xcy1 = yb - yay2 = yb - ycres = x1 * y2 - x2 * y1if res > 0: print "RIGHT"elif res < 0: print "LEFT"else: print "TOWARDS"