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<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

const int    INF = 1000000000;
const ll     MOD = 1000000007LL;
const double EPS = 1E-12;

struct Point : public complex<double>
{
public:
  Point() { this->real(0);  this->imag(0); }
  Point(const double& x, const double& y) { this->real(x);  this->imag(y); }
  Point(const complex<double> w)  { this->real(w.real());  this->imag(w.imag()); }
  inline double dot(Point p){ return (conj(*this) * p).real(); }
  inline double det(Point p){ return (conj(*this) * p).imag(); }
};

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

int ccw(Point a, Point b, Point c)
{
  b -= a;
  c -= a;
  if(b.det(c) > 0.0)    return  1;
  if(b.det(c) < 0.0)    return -1;
  if(b.dot(c) < 0.0)    return  2;
  if(norm(b) < norm(c)) return -2;
  return 0.0;
}

double x[3], y[3];
double px, py;

int main()
{
  while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){
    Point A = Point(x[0], y[0]);
    Point B = Point(x[1], y[1]);
    Point C = Point(x[2], y[2]);
    Point P = Point(px, py);
    Point AB = B - A, BC = C - B, CA = A - C;
    Point AP = P - A, BP = P - B, CP = P - C;

    bool ok = false;
    if(AB.det(BP) > 0 && BC.det(CP) > 0 && CA.det(AP) > 0) ok = true;
    if(AB.det(BP) < 0 && BC.det(CP) < 0 && CA.det(AP) < 0) ok = true;

    puts(ok ? "YES" : "NO");
  }

  return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
	double x1, y1, x2, y2, x3, y3, xp, yp;
	double a, b, c;
	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
		a = (x2 - x1)*(yp - y1) - (xp - x1)*(y2 - y1);
		b = (x3 - x2)*(yp - y2) - (xp - x2)*(y3 - y2);
		c = (x1 - x3)*(yp - y3) - (xp - x3)*(y1 - y3);
		if((a > 0 && b > 0 && c > 0) || (a < 0 && b < 0 && c < 0)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: 
#include <iostream>
#include <cmath>

using namespace std;

double compute( double x[], double y[] ){

  double result = 0;
  for( int j = 1 ; j <= 3 ; j++ ){
    int J = j + 1;
    if( j == 3 ) J = 1;
    result += ( x[j]*y[J] - x[J]*y[j] );
  }
  result = abs(result) / 2;
  return result;
}

double heron(double a,double b,double c){
  double s = (a + b + c) / 2;
  double S = sqrt(s*(s - a)*(s - b)*(s - c) ); //テ」ツδ佚」ツδュテ」ツδウテ」ツ?ョテ・ツ?ャテ・ツシツ湘」ツつ津、ツスツソテァツ板ィ
  return S;
}

int main(void){

  double x[5];
  double y[5];

  while( cin >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3] >> x[4] >> y[4] ){

    double area1 = compute(x,y);
 
    double a = sqrt( pow( x[1] - x[2], 2 ) + pow( y[1] - y[2], 2 ) );
    double b = sqrt( pow( x[1] - x[3], 2 ) + pow( y[1] - y[3], 2 ) );
    double c = sqrt( pow( x[3] - x[2], 2 ) + pow( y[3] - y[2], 2 ) );
    double d = sqrt( pow( x[1] - x[4], 2 ) + pow( y[1] - y[4], 2 ) );
    double e = sqrt( pow( x[2] - x[4], 2 ) + pow( y[2] - y[4], 2 ) );
    double f = sqrt( pow( x[3] - x[4], 2 ) + pow( y[3] - y[4], 2 ) );
    double area2 = heron(d,e,a) + heron(d,f,b) + heron(e,f,c);

    if( (float)area1 == (float)area2) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const double EPS = 1e-12;
const double INF = 1e12;

typedef complex<double> P;
typedef vector< complex<double> >polygon;
namespace std {
  	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);
}


int contains(const polygon& poly, const P & p) {
	bool in = false;
	for (int i = 0; i < SZ(poly); ++i) {
		P a = poly[i] - p, b = poly[(i+1)%SZ(poly)] - p;
		if (imag(a) > imag(b)) swap(a, b);
		if (imag(a) <= 0 && 0 < imag(b))
	  		if (cross(a, b) < 0) in = !in;
		if (cross(a, b) == 0 && dot(a, b) <= 0) return 1;
	}
	return in ? 2 : 0;
}


int main(){
	
	vector<string>res;
	polygon tri(3);
	P p;
	while(cin>>tri[0].real()>>tri[0].imag()>>tri[1].real()>>tri[1].imag()>>tri[2].real()>>tri[2].imag()>>p.real()>>p.imag()){
		if(contains(tri,p)==2)res.PB("YES");
		else res.PB("NO");
	}
	REP(i,SZ(res))cout<<res[i]<<endl;
	return 0;
}