Go: package main

import (
        "fmt"
)

func main() {
        var x1, y1, x2, y2, x3, y3, px, py float64
        var oax, oay, obx, oby, opx, opy float64
        var det float64
        var s, t float64

        for {
                _, err := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py)
                if err != nil {
                        break
                }
                oax = x2 - x1
                oay = y2 - y1
                obx = x3 - x1
                oby = y3 - y1
                opx = px - x1
                opy = py - y1
                det = oax*oby - obx*oay

                if det == 0 {
                        fmt.Printf("NO\n")
                } else {
                        s = (oby*opx - obx*opy) / det
                        t = (oax*opy - oay*opx) / det

                        if (s+t < 1 && s > 0 && t > 0) {
                                fmt.Printf("YES\n")
                        } else {
                                fmt.Printf("NO\n")
                        }
                }
        }
}

Python: g=lambda a,b:abs(a[0]*b[1]-a[1]*b[0])

while True:
    try:t=input()
    except:break
    l=[float(i) for i in t.split()]
    ba=[l[0]-l[2],l[1]-l[3]]
    ab=[-i for i in ba]
    cb=[l[2]-l[4],l[3]-l[5]]
    bc=[-i for i in cb]
    ca=[l[0]-l[4],l[1]-l[5]]
    ac=[-i for i in ca]
    ap=[l[6]-l[0],l[7]-l[1]]
    bp=[l[6]-l[2],l[7]-l[3]]
    cp=[l[6]-l[4],l[7]-l[5]]
    if g(ab,ac)<g(ab,ap) or g(ba,bc)<g(ba,bp) or g(ca,cb)<g(ca,cp):
        print("NO")
    else:
        print("YES")

Python: # coding: utf-8

def linecheck(x1, y1, x2, y2, xp, yp):
	if yp - y1 > (xp - x1) * (y2 - y1) / (x2 - x1):
		return 1
	elif yp - y1 < (xp - x1) * (y2 - y1) / (x2 - x1):
		return -1

while True:
	try:
		x1, y1, x2, y2, x3, y3, xp, yp = map(float, raw_input().split())
		if x1 == x2:
			if (x1 < xp and xp < x3) or (x1 > xp and xp > x3):
				judge = -1
			else:
				judge = 1
			judge *= linecheck(x1, y1, x3, y3, xp, yp) * linecheck(x2, y2, x3, y3, xp, yp)
		elif x2 == x3:
			if (x1 < xp and xp < x3) or (x1 > xp and xp > x3):
				judge = -1
			else:
				judge = 1
			judge *= linecheck(x1, y1, x2, y2, xp, yp) * linecheck(x1, y1, x3, y3, xp, yp)
		elif x3 == x1:
			if (x1 < xp and xp < x2) or (x1 > xp and xp > x2):
				judge = -1
			else:
				judge = 1
			judge *= linecheck(x1, y1, x2, y2, xp, yp) * linecheck(x2, y2, x3, y3, xp, yp)
		else:
			judge = linecheck(x1, y1, x2, y2, xp, yp) * linecheck(x1, y1, x3, y3, xp, yp) * linecheck(x2, y2, x3, y3, xp, yp)
		if judge > 0:
			print("YES")
		elif judge < 0:
			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:
        return(-1,-1)
    
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: # Aizu Problem 0012: Point in Triangle
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def point_in_triangle(trig, x, y):
    x1, y1, x2, y2, x3, y3 = trig[:]
    a = ((y2 - y3)*(x - x3) + (x3 - x2)*(y - y3)) / ((y2 - y3)*(x1 - x3) + (x3 - x2)*(y1 - y3))
    b = ((y3 - y1)*(x - x3) + (x1 - x3)*(y - y3)) / ((y2 - y3)*(x1 - x3) + (x3 - x2)*(y1 - y3))
    c = 1 - a - b
    return 0 < a < 1 and 0 < b < 1 and 0 < c < 1

          
for line in sys.stdin:
    inp = [float(_) for _ in line.split()]
    print("YES" if point_in_triangle(inp[:6], inp[6], inp[7]) else "NO")

Python: while True:
    try:
        ax, ay, bx, by, cx, cy, px, py = map(float, input().split())
        a = (bx - ax) * (py - ay) - (by - ay) * (px - ax)
        b = (cx - bx) * (py - by) - (cy - by) * (px - bx)
        c = (ax - cx) * (py - cy) - (ay - cy) * (px - cx)
        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: import math
from sys import stdin

def length(u,v):
    x0=u[0]
    y0=u[1]
    x1=v[0]
    y1=v[1]
    return(math.sqrt(((x1-x0)**2+(y1-y0)**2)))

def s(a,b,c):
    l=length(a,b)
    m=length(b,c)
    n=length(c,a)
    o = (l+m+n)/2.0
    p=o*(o-l)*(o-m)*(o-n)
    q=math.sqrt(p)
    return(q)

if __name__ == "__main__": 
   eps=1e-5
   for line in stdin:
        v=list(map(float,line.split()))
        a=(v[0],v[1])
        b=(v[2],v[3])
        c=(v[4],v[5])
        p=(v[6],v[7])
        s0=s(a,b,c)
        s1=s(p,a,b)
        s2=s(p,b,c)
        s3=s(p,c,a)
        if abs(s0 - (s1+s2+s3))< eps:
            print("YES")
        else:
            print("NO")

Python: from sys import stdin
for line in stdin:
    x1,y1,x2,y2,x3,y3,xp,yp = [float(i) for i in line.split()]
    ab_cross_ap = (x2-x1)*(y1-yp)-(y2-y1)*(x1-xp)
    bc_cross_bp = (x3-x2)*(y2-yp)-(y3-y2)*(x2-xp)
    ca_cross_cp = (x1-x3)*(y3-yp)-(y1-y3)*(x3-xp)
    if ab_cross_ap < 0 and bc_cross_bp < 0 and ca_cross_cp < 0:
        print("YES")
    else:
        print("NO")

Python: import sys
def gaiseki(x0, y0, x1, y1):
    return x0*y1 - y0*x1
def muki(x0, y0, x1, y1, x2, y2):
    return gaiseki(x1-x0, y1-y0, x2-x1, y2-y1) > 0
for line in sys.stdin:
    x0, y0, x1, y1, x2, y2, xp, yp = map(float, line.split())
    m0 = muki(xp, yp, x0, y0, x1, y1)
    m1 = muki(xp, yp, x1, y1, x2, y2)
    m2 = muki(xp, yp, x2, y2, x0, y0)
    if m0 == m1 and m1 == m2:
        print('YES')
    else:
        print('NO')

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: from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

for line in stdin:
    sets = [float(s) for s in line.split()]
    xa, xb = sorted(sets[:5:2])[::2]
    ya, yb = sorted(sets[1:6:2])[::2]
    if xa < sets[6] < xb and ya < sets[7] < yb:
        print('YES')
    else:
        print('NO')

Python: # -*- coding:utf-8 -*-

def main():
    while True:
        try:
            ax,ay,bx,by,cx,cy,px,py=map(float,input().split())
            A=(bx-ax)*(py-ay)-(by-ay)*(px-ax)
            B=(cx-bx)*(py-by)-(cy-by)*(px-bx)
            C=(ax-cx)*(py-cy)-(ay-cy)*(px-cx)

            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
            
    
if __name__ == '__main__':
    main()

Python: try:
    while True:
        li = [float(x) for x in input().split()]
        if li:
            lix = [li[i] for i in range(6) if i % 2 == 0]
            liy = [li[i] for i in range(6) if i % 2 != 0]
            x, y = li[6], li[7]
            if min(lix) <= x <= max(lix) and min(liy) <= y <= max(liy):
                print("YES")
            else:
                print("NO")
except EOFError:
    pass