Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

Python: global r

def checker(x1,y1,x2,y2,xp,yp):
	vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1)
	if vec > 0:
		return int(1)
	elif vec < 0:
		return int(-1)

if __name__ == '__main__':
	while True:
		try:
			x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split())
			r = 0
			r += int(checker(x1,y1,x2,y2,xp,yp))
			r += int(checker(x2, y2, x3, y3, xp, yp))
			r += int(checker(x3, y3, x1, y1, xp, yp))
			if r == 3 or r == -3:
				print("YES")
			else:
				print("NO")
		except EOFError:
			break

Python: 
x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()]

x_vector_1to2=x2-x1;
y_vector_1to2=y2-y1;
x_vector_1to3=x3-x1;
y_vector_1to3=y3-y1;
x_vector_p=xp-x1;
y_vector_p=yp-y1;

def renritu(p,q,r,s,t,u):  # renritu(p,q,r,s,t,u) px + qy = r  sx+ty=u
    a=p; b=q; c=r; d=s; e=t; f=u;
    a1=a*d; b1=b*d; c1=c*d; d1=d*a; e1=e*a; f1=f*a;
    res_y=b1-e1;
    if res_y != 0 :
        res_y =(c1-f1)/res_y;
        res_x =(c-b*res_y)/a;
        return(res_x,res_y)
    else:
        res_x=c/a;
    
res=renritu(x_vector_1to2,x_vector_1to3,x_vector_p,y_vector_1to2,y_vector_1to3,y_vector_p)
if res[0] >=0 and res[1] >=0 and res[0]+res[1]<=1:
    print("YES")
else:
    print("NO")

Python: class vector(object):
    def __init__(self,a,b):
        self.x=b.x-a.x
        self.y=b.y-a.y
    @staticmethod
    def cross_product(a,b):
        return a.x*b.y-a.y*b.x
class vertex(object):
    def __init__(self,a):
        self.x=a[0]
        self.y=a[1]
class circle(object):
    def __init__(self,p,r):
        self.px=p.x
        self.py=p.y
        self.r=r
class triangle(object):
    def __init__(self,a,b,c):
        self.a=a
        self.b=b
        self.c=c
        import math
        self.ab=math.sqrt((self.a.x-self.b.x)**2+(self.a.y-self.b.y)**2)
        self.bc=math.sqrt((self.b.x-self.c.x)**2+(self.b.y-self.c.y)**2)
        self.ca=math.sqrt((self.c.x-self.a.x)**2+(self.c.y-self.a.y)**2)
        c=self.ab
        a=self.bc
        b=self.ca
        self.cosA=(b**2+c**2-a**2)/(2*b*c)
        self.cosB=(a**2+c**2-b**2)/(2*a*c)
        self.cosC=(b**2+a**2-c**2)/(2*b*a)
        self.sinA=math.sqrt(1-self.cosA**2)
        self.sinB=math.sqrt(1-self.cosB**2)
        self.sinC=math.sqrt(1-self.cosC**2)
        self.sin2A=2*self.sinA*self.cosA
        self.sin2B=2*self.sinB*self.cosB
        self.sin2C=2*self.sinC*self.cosC
    def area(self):
        import math
        s=(self.ab+self.bc+self.ca)/2
        S=math.sqrt(s*(s-self.ab)*(s-self.bc)*(s-self.ca))
        return S
    def circumscribed(self):
        R=self.ab/(2*self.sinC)
        px=(self.sin2A*self.a.x+self.sin2B*self.b.x+self.sin2C*self.c.x)/(self.sin2A+self.sin2B+self.sin2C)
        py=(self.sin2A*self.a.y+self.sin2B*self.b.y+self.sin2C*self.c.y)/(self.sin2A+self.sin2B+self.sin2C)
        px=round(px,3)
        py=round(py,3)
        R=round(R,3)
        p=vertex((px,py))
        return circle(p,R)
    def isin(self,p):
        AB=vector(self.a,self.b)
        BC=vector(self.b,self.c)
        CA=vector(self.c,self.a)
        AP=vector(self.a,p)
        BP=vector(self.b,p)
        CP=vector(self.c,p)
        if (vector.cross_product(AB,AP)>0 and vector.cross_product(BC,BP)>0 and vector.cross_product(CA,CP)>0)or(vector.cross_product(AB,AP)<0 and vector.cross_product(BC,BP)<0 and vector.cross_product(CA,CP)<0):
            return 'Yes'
        else:return 'No'
A=[]
B=[]
C=[]
p=[]
import sys
for line in sys.stdin:
    a,b,c,d,e,f,g,h=list(map(float,line.split()))
    A.append(vertex((a,b)))
    B.append(vertex((c,d)))
    C.append(vertex((e,f)))
    p.append(vertex((g,h)))
for i in range(len(A)):
    Triangle=triangle(A[i],B[i],C[i])
    print(Triangle.isin(p[i]))

Python: def checker(x1,y1,x2,y2,xp,yp):
	r = 0
	vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1)
	if vec > 0:
		r = 1
		return r
	elif vec < 0:
		r = -1
		return r

if __name__ == '__main__':
	while True:
		try:
			x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split())
			r = 0
			r += int(checker(x1,y1,x2,y2,xp,yp))
			r += int(checker(x2, y2, x3, y3, xp, yp))
			r += int(checker(x3, y3, x1, y1, xp, yp))
			if r == 3 or r == -3:
				print("YES")
			else:
				print("NO")
		except EOFError:
			break

Python: import fileinput


class Vector2D:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def dot(self, vec2d):
        return (self.x * vec2d.y) - (self.y * vec2d.x)


for line in fileinput.input():
    x1, y1, x2, y2, x3, y3, xp, yp = [float(r) for r in line.split()]
    v1To2 = Vector2D(x2 - x1, y2 - y1)
    v2To3 = Vector2D(x3 - x2, y3 - y2)
    v3To1 = Vector2D(x1 - x3, y1 - y3)
    v1ToP = Vector2D(xp - x1, yp - y1)
    v2ToP = Vector2D(xp - x2, yp - y2)
    v3ToP = Vector2D(xp - x3, yp - y3)

    if (v1To2.dot(v1ToP) < 0 and v2To3.dot(v2ToP) < 0 and v3To1.dot(v3ToP) < 0) or (v1To2.dot(v1ToP) > 0 and v2To3.dot(v2ToP) > 0 and v3To1.dot(v3ToP) > 0):
        print("YES")
    else:
        print("NO")

Python: 

while 1:
    try:
        x1, y1, x2, y2, x3, y3, px, py = map(float, input().split())
        a = (x2-x1) * (py-y1) - (y2-y1) * (px-x1)
        b = (x3-x2) * (py-y2) - (y3-y2) * (px-x2)
        c = (x1-x3) * (py-y3) - (y1-y3) * (px-x3)
        if (a < 0 and b < 0 and c < 0) or (a > 0 and b > 0 and c > 0):
            print("YES")
        else:
            print("NO")
    except:
        break;

Python: length=[float(0) for i in range(3)]
while 1:
    try:
      x1,y1,x2,y2,x3,y3,x4,y4=[float(i) for i in input().split( )]
      len1=(x1-x2)**2+(y1-y2)**2
      len2=(x2-x3)**2+(y2-y3)**2
      len3=(x3-x1)**2+(y3-y1)**2
      length[0]=(x1-x4)**2+(y1-y4)**2
      length[1]=(x2-x4)**2+(y2-y4)**2
      length[2]=(x3-x4)**2+(y3-y4)**2
      if ((max(length)>len1)and(max(length)>len2)and(max(length)>len3)):
          print("NO")
      else:
          print("YES")
    except EOFError:
        break

Python: import math
while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
        x = [x1, x3, x3, x1]
        y = [y1, y2, y3, y1]
        x = list(map(lambda x:x-xp, x))
        y = list(map(lambda y:y-yp, y))
        cos = lambda a1,a2,b1,b2:(a1*b1+a2*b2)/((a1**2+a2**2)**0.5*(b1**2+b2**2)**0.5)
        if sum(math.acos(cos(x[i], y[i], x[i+1], y[i+1])) for i in range(3)) < 2 * math.pi - 1e-3:
            print('NO')
        else:
            print('YES')
    except:
        break

Python: while(True):
    try:
        x1,y1,x2,y2,x3,y3,xp,yp = map(float, input().split())
        c1 = (x2-x1)*(yp-y1)-(y2-y1)*(xp-x1)
        c2 = (x3-x2)*(yp-y2)-(y3-y2)*(xp-x2)
        c3 = (x1-x3)*(yp-y3)-(y1-y3)*(xp-x3)
        if (c1<0 and c2<0 and c3<0) or (c1>0 and c2>0 and c3>0):
            print("YES")
            continue
        print("NO")
    except:
        break

Python: import sys
def area(x1,y1,x2,y2,x3,y3):
    return abs((x1*(y2-y3) + x2*(y3-y1)+ x3*(y1-y2))/2.0)
for line in sys.stdin.readlines():
    x1, y1, x2, y2, x3, y3, xp, yp=map(float,line.split())
    a1=area(x1,y1,x2,y2,xp,yp)
    a2=area(x3,y3,x2,y2,xp,yp)
    a3=area(x1,y1,x3,y3,xp,yp)
    a=area(x1,y1,x2,y2,x3,y3)
    if(a==(a1+a2+a3)):
        print("YES")
    else:
        print("NO")