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 <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};

int main()
{
  double x1,y1,x2,y2,x3,y3,xp,yp;
  while( cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
  double s;
  double a,b,c;
  a =sqrt(pow(x1-x2,2)+pow(y1-y2,2));
  c =sqrt(pow(x1-x3,2)+pow(y1-y3,2));
  b =sqrt(pow(x2-x3,2)+pow(y2-y3,2));
  s =(a+b+c)/2;
  double abcS =sqrt(s*(s-a)*(s-b)*(s-c));
  double ap,bp,cp;
  ap =sqrt(pow(x1-xp,2)+pow(y1-yp,2));
  bp =sqrt(pow(x2-xp,2)+pow(y2-yp,2));
  cp =sqrt(pow(x3-xp,2)+pow(y3-yp,2));
  s =(ap+bp+a)/2;
  double abpS =sqrt(s*(s-ap)*(s-a)*(s-bp));
  s =(bp+cp+b)/2;
  double bpcS =sqrt(s*(s-bp)*(s-cp)*(s-b));
  s =(ap+cp+c)/2;
  double apcS =sqrt(s*(s-ap)*(s-cp)*(s-c));
  if(abpS+bpcS+apcS-abcS<1e-9)
    cout <<"YES"<<endl;
  else
    cout <<"NO"<<endl;
  
  }
  return 0;
}

C++: #include <iostream>

using namespace std;


int main(){
	double x[3], y[3];
	double px, py;

	double ax, ay, bx, by;
	double s, t;

	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){
		ax = x[1]-x[0];
		ay = y[1]-y[0];
		bx = x[2]-x[0];
		by = y[2]-y[0];
		px = px-x[0];
		py = py-y[0];

		t = (px*by - py*bx)/(ax*by - ay*by);
		s = (px*ay - py*ax)/(ay*bx - ax*by);

		if(t > 0 && s > 0 && t+s < 1) cout << "YES" << endl;
		else cout << "NO" << endl;

	}
}

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

double Area(double* x1, double* y1, double* x2, double* y2){
  return (*x1 * *y2 - *x2 * *y1)/2.0;
}

double Segitiga(double* a, double * b, double* c, double* d, double* e, double* f){
  return abs (Area(a,b,c,d) + Area(c,d,e,f) + Area(e,f,a,b));
}

int main(){
  double a, b, c, d, e, f, g, h, ta, tb;
  cin >> a >> b >> c >> d >> e >> f >> g >> h;
  ta = Segitiga(&a, &b, &c, &d, &e, &f);
  tb = Segitiga(&a, &b, &c, &d, &g, &h) + Segitiga(&a, &b, &e, &f, &g, &h) + Segitiga(&c, &d, &e, &f, &g, &h);

  if(tb-ta < 1e-8)
    cout << "YES\n";
  else
    cout << "NO\n";
  
return 0;
}

C++: #include <iostream>
#include <cmath>
#include <complex>
using namespace std;
typedef complex<double> P;
double cp(P a, P b){
	return (conj(a)*b).imag();
}
int main(){
	P p[4];
	double x,y;
	while(cin >> x){
		cin >> y;
		p[0] = P(x,y);
		for(int i = 1; i < 4; ++i){
			cin >> x >> y;
			p[i] = P(x,y);
		}
		for(int i = 0 ;i < 3; ++i) p[i] -= p[3];
		if(cp(p[0],p[1])*cp(p[1],p[2]) > 0 && cp(p[0],p[1])*cp(p[2],p[0]) > 0) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

C++: #include <iostream>
#include <set>
#include <cassert>
namespace boost {
template <class T>
struct integer_iterator {
    T a;
    bool operator != (integer_iterator const & it) const { return a != it.a; }
    T operator * () const { return a; }
    integer_iterator & operator ++ () { ++ a; return *this; }
    integer_iterator operator ++ (int) { return { a ++ }; }
};
template <class T>
struct integer_range {
    T l, r;
    typedef integer_iterator<T> iterator;
    iterator begin() const { return { l }; }
    iterator end  () const { return { r }; }
};
template <class T>
integer_range<T> irange(T l, T r) { assert (l <= r); return { l, r }; }
template <class T>
struct integer_iterator_with_step {
    T a, d, i;
    bool operator != (integer_iterator_with_step const & it) const { return a != it.a or d != it.d or i != it.i; }
    T operator * () const { return a+d*i; }
    integer_iterator_with_step & operator ++ () { ++ i; return *this; }
    integer_iterator_with_step operator ++ (int) { return { a, d, i ++ }; }
};
template <class T>
struct strided_integer_range {
    T l, r, s;
    typedef integer_iterator_with_step<T> iterator;
    iterator begin() const { return { l, s, 0 }; }
    iterator end  () const { return { l, s, (r - l) / s }; }
};
template <class T>
strided_integer_range<T> irange(T l, T r, T s) { assert (s > 0 ? l <= r : s < 0 ? l >= r : false); return { l, r, s }; }
}
#include <utility>
#include <cmath>
#define ttt template <typename T>
#define pca point<T> const &
ttt struct point { T x, y; };
ttt point<T> operator + (pca a, pca b) { return { a.x+b.x, a.y+b.y }; }
ttt point<T> operator - (pca a, pca b) { return { a.x-b.x, a.y-b.y }; }
ttt point<T> operator - (pca a) { return { -a.x, -a.y }; }
ttt point<T> operator * (T a, pca b) { return { a*b.x, a*b.y }; }
ttt std::pair<T,T> to_pair(pca a) { return { a.x, a.y }; }
ttt bool operator == (pca a, pca b) { return to_pair(a) == to_pair(b); }
ttt bool operator != (pca a, pca b) { return to_pair(a) != to_pair(b); }
ttt bool operator <  (pca a, pca b) { return to_pair(a) <  to_pair(b); }
ttt bool operator <= (pca a, pca b) { return to_pair(a) <= to_pair(b); }
ttt bool operator >= (pca a, pca b) { return to_pair(a) >= to_pair(b); }
ttt bool operator >  (pca a, pca b) { return to_pair(a) >  to_pair(b); }
ttt T length_squared(pca p) { return p.x*p.x + p.y*p.y; }
ttt double length(pca p) { return sqrt(length_squared(p)); }
ttt point<T> normalized(pca a) { return (1 / length(a)) * a; }
ttt T   dot(pca p, pca q) { return p.x * q.x + p.y * q.y; }
ttt T cross(pca p, pca q) { return p.x * q.y - p.y * q.x; }
ttt int ccw(pca a, pca b, pca c) { T x = cross(b - a, c - a); return x > 0 ? 1 : x < 0 ? -1 : 0; }
#undef ttt
#undef pca
template <typename T> std::istream & operator >> (std::istream & input, point<T> & p) { return input >> p.x >> p.y; }
template <typename T> std::ostream & operator << (std::ostream & output, const point<T> & p) { return output << p.x << ' ' << p.y; }
using namespace std;
using namespace boost;
int main() {
    while (true) {
        point<double> a, b, c, p;
        cin >> a >> b >> c >> p;
        if (not cin) break;
        set<int> s;
        s.insert(ccw(a,b,p));
        s.insert(ccw(b,c,p));
        s.insert(ccw(c,a,p));
        cout << (s.size() == 1 ? "YES" : "NO") << endl;
    }
    return 0;
}