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 <iostream>
using namespace std;                                                                     |#include <stdio.h>
                                                                                         |#include <math.h>
int main() {                                                                             |using namespace std;
  double x1,y1,x2,y2,x3,y3,xp,yp;                                                        |
  double a[2],b[2];                                                                      |int main() {
  double A,B;                                                                            |  double a, b, c, d, e, f;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {                           |  double x, y;
    a[0] = x2 - x1;                                                                      |  while( cin >> a >> b >> c >> d >> e >> f) {
    a[1] = y2- y1;                                                                       |x = (c * e - b * f) / (a * e - b * d);
    b[0] = x3 - x1;                                                                      |    y = (a * f - c * d) / (a * e - b * d);
    b[1] = y3 - y1;                                                                      |    x *= 1000;
    //vect[0] = A * a[0] + B * b[0];                                                     |    x += 0.5;
    //vect[1] = A * a[1] + B * b[1];                                                     |    x = floor(x);
    A = (xp * b[1] - b[0] * yp) / (a[0] * b[1] - b[0] * a[1]);                           |    x /= 1000;
    B = (a[0] * yp - xp * a[1]) / (a[0] * b[1] - b[0] * a[1]);                           |    y *= 1000;
    if ((A+B <= 1) && (A > 0) && (B > 0)) {                                              |    y += 0.5;
      cout << "YES" << endl;                                                             |    y = floor(y);
    }                                                                                    |    y /= 1000;
    else {                                                                               |
      cout << "NO" << endl;                                                              |    printf("%.3f %.3f\n", x, y);
    }                                                                                    |
  }                                                                                      |  }
}

C++: //#include <bits/stdc++.h>
#include <complex>
#include <iostream>
#define rep(i,l,n) for(int i=l;i<n;i++)
using namespace std;
typedef complex<double> xy_t;

double cross_product(xy_t a,xy_t b){
	return (conj(a)*b).imag();
}

double x[4],y[4];

int main(){
	while(true){
		rep(i,0,4) cin>>x[i]>>y[i];
		if(!cin) break;
		xy_t a(x[0],y[0]),b(x[1],y[1]),c(x[2],y[2]),p(x[3],y[3]);
		int pab,pbc,pca;
		pab=cross_product(a-p,b-p);
		pbc=cross_product(b-p,c-p);
		pca=cross_product(c-p,a-p);
		bool ok=abs(pab+pbc+pca)==abs(pab)+abs(pbc)+abs(pca);
		cout<<(ok?"YES":"NO")<<endl;
	}
}

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 true;	// 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;
}