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>
#include <complex>
#include <map>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define x(a) (a).real()
#define y(a) (a).imag()
typedef long double D;
typedef bool B;
typedef complex<D> P;   //点
typedef complex<D> V;   //ベクトル
typedef pair<P,P>  L;   //直線
typedef pair<P,D>  C;   //円
typedef vector<P>  Pol; //多角形

//変数名定義
const D INF = 1e100;
const D EPS = 1e-8;
const D PI = acos(-1);

template<class T> bool operator==(T a, T b){return abs(a - b )< EPS;}
template<class T> int sig(T r) {return (r==0||r==-0) ? 0 : r > 0 ? 1 : -1;}

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

// ベクトルaの絶対値を求める
// D Length = abs(a);

// 2点a,b間の距離を求める
// D Distance = abs(a-b); 

// 内積 (Inner Product) : a・b = |a||b|cosθ
D IP(V a, V b) {
	return (a.real() * b.real() + a.imag() * b.imag());
}

// 外積 (Exterior Product) : a×b = |a||b|sinθ
D EP(V a, V b) {
	return (a.real() * b.imag() - a.imag() * b.real());
}

// 2直線の直交判定 : a⊥b <=> IP(a, b) = 0
B IsVecular(P a1, P a2, P b1, P b2) {
	return IP(a1-a2, b1-b2)==0.0;
}

// 2直線の平行判定 : a//b <=> EP(a, b) = 0
B IsParallel(P a1, P a2, P b1, P b2) {
	return EP(a1-a2, b1-b2)== 0.0;
}


// 点と直線の距離 (Distance of Point and Line)  //l1の構造 x座標 first<second y座標 first>second 右上 正 左下 負 一致の
D  DPL(P p,L l){
	V v1=(p-l.first);
	V v2=(l.second-l.first);
	return EP(v1,v2)/abs(v1);
}

// 三角形の領域判定 Teritory of Triangle 内部のみ
B TT(P p1,P p2,P p3,P p){
	L l1,l2,l3;
	l1=make_pair(p2,p3);
	l2=make_pair(p3,p1);
	l3=make_pair(p1,p2);

	if(sig(DPL(p1,l1))!=sig(DPL(p,l1)))
		return false;
	else if(sig(DPL(p2,l2))!=sig(DPL(p,l2)))
		return false;
	else if(sig(DPL(p3,l3))!=sig(DPL(p,l3)))
		return false;
	else
		return true;
}


//変数名 = 型 代入したいもの
//example : v1 = V(5.0,-3.0) p1=P(0.0,4.0)
int main(void){
	int n; 
	while(true){
		if(cin.eof())
			break;
		P point[4];	
		rep(j,4)
		cin >> point[j].real() >> point[j].imag() ;
		if (TT(point[0],point[1],point[2],point[3]))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
double helon(double x1,double y1,double x2,double y2,double x3,double y3){
	double a,b,c,s,area;
	a = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
	b = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
	c = sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
	s = (a+b+c)/2;
	area = sqrt(s*(s-a)*(s-b)*(s-c));
	return area;
}

int main(){
	double e=0.0000000001;
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		double s,s1,s2,s3;
		s = helon(x1,y1,x2,y2,x3,y3);
		s1 = helon(xp,yp,x1,y1,x2,y2);
		s2 = helon(xp,yp,x2,y2,x3,y3);
		s3 = helon(xp,yp,x3,y3,x1,y1);
		cout<<s<<" "<<s1<<" "<<s2<<" "<<s3<<endl;
		if(fabs(s1)<e || fabs(s2)<e || fabs(s3)<e)
			cout<<"NO"<<endl;
		else if(fabs(s-(s1+s2+s3))<e)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
		
	}
	return 0;
}

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

typedef complex<double> Point;

double cross(Point a, Point b){
    return (conj(a)*b).imag();
}

int main(){
    Point V[3], P;
    while(!cin.eof()){
        for(int i=0; i<3; i++){
            double x, y; cin >> x >> y;
            V[i] = {x, y};
        }
        double x, y; cin >> x >> y;
        P = {x, y};
        
        int sum1 = 0, sum2 = 0;
        for(int i=0; i<3; i++){
            double x = cross(V[(i+1)%3]-V[i], (P-V[i]));
            sum1 += x<=0;
            sum2 += x>=0;
        }
        cout << (sum1==3 || sum2==3? "YES": "NO") << endl;
    }
    return 0;
}

C++: #include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <iterator>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) container.begin(), container.end()
#define RALL(container) container.rbegin(), container.rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

const int INF = 1<<28;
const double EPS = 1e-10;
const int MOD = 1000000007;

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

typedef complex<double> P;
typedef vector<P> G;
struct L : public vector<P>{
	L(P p1, P p2){this->push_back(p1);this->push_back(p2);}
};
istream& operator>>(istream &is, P &p) {
	double x, y;
	is >> x >> y;
	p = P(x, y);
	return is;
}
inline int sig(double x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); }
inline double norm(const P &p){return p.X*p.X+p.Y*p.Y;}
inline double inp(const P& a, const P& b){return (conj(a)*b).X;}
inline double outp(const P& a, const P& b){return (conj(a)*b).Y;}
inline bool sp_intersect(const L &s, const P &p){return !sig(norm(s[0]-p) + norm(s[1] - p) - norm(s[0] - s[1]));}

bool gp_contains(const G &g, const P &p){
	int n = g.size();
	double sum = .0;
	REP(i, n){
		if(sp_intersect(L(g[i], g[(i+1)%n]), p)) return false;	// online
		sum += arg((g[i] - p) / (g[(i+1)%n] - p));
	}
	return sig(sum);
}

int n;

int main(){
	ios::sync_with_stdio(false);
	while(1){
		G g;
		P p;
		REP(i, 3){
			if(!(cin >> p)) return 0;
			g.push_back(p);
		}
		cin >> p;
		puts(gp_contains(g, p) ? "YES" : "NO");
	}
	return 0;
}