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")
                        }
                }
        }
}

C++: #include<iostream>
using namespace std;

bool point(double x1, double y1, double x2, double y2, double x3, double y3, double px, double py){
	double a1 = (x2 != x1) ? (y2 - y1) / (x2 - x1) : 10000000 * (((y2 - y1) < 0) * 2 - 1 );
	double a2 = (x3 != x1) ? (y3 - y1) / (x3 - x1) : 10000000 * (((y3 - y1) < 0) * 2 - 1 );
	double ap = (px != x1) ? (py - y1) / (px - x1) : 10000000 * (((py - y1) < 0) * 2 - 1 );
	
	if ((a1 > ap && a2 < ap) || (a1 < ap && a2 > ap))
		return true;
	else
		return false;
}

int main(){
	double x1, y1, x2, y2, x3, y3, px, py;

	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> px >> py)
		std::cout << ((point(x1, y1, x2, y2, x3, y3, px, py) && point(x2, y2, x3, y3, x1, y1, px, py)) ? "YES" : "NO") << std::endl;

	return 0;
}

C++: #include <iostream>
#include <complex>
#include <vector>
#include <cstdio>
using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;

bool operator < (const P& a, const P& b) {
  return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
}

double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

int main() {
  double x1,y1,x2,y2,x3,y3, x, y;
  while(cin >> x1) {
    cin >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y;
    P a1(x1,y1), a2(x2,y2), a3(x3,y3), a(x,y);

    if (ccw(a1,a2,a)==1 && ccw(a2,a3,a)==1 && ccw(a3, a1, a)==1)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
}

C++: #include<iostream>
#include<math.h>

using namespace std;

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	double l1,l2,l3,l,pl;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		l1=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
		l2=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
		l3=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
		if(l1+l2>l2+l3){
			if(l2+l3>l3+l1)l=l3+l1;
			else l=l2+l3;
		}else{
			l=l1+l2;
		}
		pl=sqrt((xp-x1)*(xp-x1)+(yp-y1)*(yp-y1))+sqrt((xp-x2)*(xp-x2)+(yp-y2)*(yp-y2))+sqrt((xp-x3)*(xp-x3)+(yp-y3)*(yp-y3));
		if(pl>l)cout<<"NO"<<endl;
		else cout<<"YES"<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
bool cross(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy) {
	double ta = (cx - dx) * (ay - cy) + (cy - dy) * (cx - ax);
	double tb = (cx - dx) * (by - cy) + (cy - dy) * (cx - bx);
	double tc = (ax - bx) * (cy - ay) + (ay - by) * (ax - cx);
	double td = (ax - bx) * (dy - ay) + (ay - by) * (ax - dx);
	return tc * td <= 0 && ta * tb <= 0;
}
signed main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while( scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF ){
		double xc = ( x1 + x2 + x3 )/3;
		double yc = ( y1 + y2 + y3 )/3;
		if (cross(x1, y1, x2, y2, xc, yc, xp ,yp) ||
				cross(x2, y2, x3, y3, xc, yc, xp ,yp) ||
				cross(x3, y3, x1, y1, xc, yc, xp ,yp)){
			cout << "NO" << endl;
		}else cout << "YES" << endl;
	}
	return 0;
}

C++: #define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()
const int INF = 1e9;
const double PI = 3.14159;
int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
using namespace std;
typedef long long ll;
//typedef pair<int, int> P;

/* struct P {
	int x, y, n;
	P(int n, int x, int y):n(n), x(x), y(y){}
	P(){}
}; */


/** 幾何ライブラリ **/
#include <complex>

#define X real()
#define Y imag()

const double EPS = 1e-11;

typedef double D;
typedef complex<D> P; // Point

struct L { // Line
	P a, b;
	L(){}
	L(P aa, P bb) : a(aa), b(bb){}
};

// 共役複素数 conj(a);

// 符号
int sig(D a, D b=0) { return a < b - EPS ? -1 : (a > b + EPS ? 1 : 0); }

// 内積
D dot(P a, P b) { return (conj(a)*b).real(); }

// 外積
D cross(P a, P b) { return (conj(a)*b).imag(); }

// 線分abに対する点cの位置
enum STATE{LEFT=1, RIGHT=-1, BACK=2, FRONT=-2, ON=0, IN=3, OUT=-3};
int ccw(P a, P b, P c)
{
	b -= a, c -= a;
	D s = sig(cross(b, c));
	if (s) return s>0 ? LEFT : RIGHT;
	if (sig(dot(b, c))<0) return BACK;
	if (sig(abs(c), abs(b))>0) return FRONT;
	return ON;
}

// 直線lに対する点pの写像
P projection(L l, P p)
{
	return l.a + (l.b-l.a)/abs(l.b-l.a) * dot(l.b-l.a, p-l.a)/abs(l.b-l.a);
}

// 直線lに対する点pの反射
P reflection(L l, P p)
{
	return p + (projection(l, p)-p)*P(2, 0);
}

// 直線abと点cの距離
D dLP(L l, P c)
{
	return abs(cross(l.b-l.a, c-l.a))/abs(l.b-l.a);
}

// 線分abと点cの距離
D dSP(L l, P c)
{
	if (sig(dot(l.b-l.a, c-l.a))<0) return abs(c-l.a);
	if (sig(dot(l.a-l.b, c-l.b))<0) return abs(c-l.b);
	return abs(cross(l.b-l.a, c-l.a))/abs(l.b-l.a);
}

// 線分と線分の交差判定
bool iSS(L s, L t)
{
	return (ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0)
			&& (ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0);
}

// 線分と線分の距離
D dSS(L s, L t)
{
	if (iSS(s, t)) return 0;
	return min(min(dSP(t, s.a), dSP(t, s.b)), min(dSP(s, t.a), dSP(s, t.b)));
}

// 線分と線分の交点 (公差していることが前提)
P cSS(L s, L t)
{
	D d1 = dLP(t, s.a);
	D d2 = dLP(t, s.b);
	D tmp = d1 / (d1 + d2);
	return s.a + (s.b-s.a)*tmp;
}

// 直線と直線の交差判定
bool iLL(L s, L t)
{
	return sig(cross(s.b-s.a, t.b-t.a))!=0;
}

// 直線と直線の交点 iLLを確認してから使用
P cLL(L s, L t)
{
	P ss = s.b - s.a, tt = t.b - t.a;
	return s.a + ss*cross(tt, t.a-s.a)/cross(tt, ss);
}

// 多角形
typedef vector<P> G;
#define GET(v, i) v[i%v.size()]

int containsGP(G g, P p)
{
	bool in=false;
	for (int i=0; i<g.size(); i++) {
		P a = GET(g, i)-p, b = GET(g, i+1)-p;
		if (ccw(a, b, p) == ON) return ON;
		if (a.Y > b.Y) swap(a, b);
		if (a.Y<0 && b.Y>=0 && sig(cross(a, b))>0) in = !in;
	}
	return in?IN:OUT;
}

/** Problem0012 : A Point In Triangle **/
int main()
{
	P a, b, c, p;
	while (cin>>a.X>>a.Y>>b.X>>b.Y>>c.X>>c.Y>>p.X>>p.Y) {
		G g;
		g.push_back(a);
		g.push_back(b);
		g.push_back(c);
		cout << (containsGP(g, p)==IN?"YES":"NO") << endl;
	}
}