Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: //#define _GRIBCXX_DEBUG
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;


// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion


// Effective std
#pragma region ESTD
template<typename C, typename T>
constexpr int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F>
constexpr int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T, typename U>
constexpr void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U>
constexpr void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C>
constexpr void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred>
constexpr void sort(C& c, Pred p) { sort(ALL(c), p); }
template<typename C>
constexpr void reverse(C& c) { reverse(ALL(c)); }
#pragma endregion


// ?´???°
#pragma region PRIME
bool is_prime(unsigned n) {
  switch(n) {
    case 0:
    case 1: return false;
    case 2: return true;
  }
  if (n%2==0) return false;
  for (unsigned i=3; i*i<=n; i+=2)
    if (n%i==0) return false;
  return true;
}
#pragma endregion


// ??§??????/?°?????????????
#pragma region TRANSFORM
void mutal_tr(string &s) {
  for(int i=s.size(); i--;) {
    if(islower(s[i])) s[i] = toupper(s[i]);
    else if (isupper(s[i])) s[i] = tolower(s[i]);
  }
}
void to_upper(string &s) { for(int i=s.size(); i--;) s[i] = toupper(s[i]); }
void to_lower(string &s) { for(int i=s.size(); i--;) s[i] = tolower(s[i]); }
#pragma endregion


// ??????
#pragma region SET
template<class T>
set<T> intersection(const set<T>& sa, const set<T>& sb) {
  set<T> ret;
  for(T a : sa) if(sb.find(a) != sb.end()) ret.insert(a);
  return ret;
}
#pragma endregion

// Union Find
#pragma region UF
struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) {}
  bool union_set(int x, int y) {
    x = root(x); y = root(y);
    if(x!=y) {
      if(data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool find_set(int x, int y) { return root(x) == root(y); }
  int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
  int size(int x) { return -data[root(x)]; }
};
#pragma endregion


// ?????°
#pragma region CONST_VAL
#define PI (2*acos(0.0))
#define EPS (1e-9)
#define MOD (int)(1e9+7)
#pragma endregion

double check(double x1, double y1, double x2, double y2, double x3, double y3){
    double ab = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    double bc = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
    double ca = sqrt((x3 - x1) * (x3 - x1) + (y3 - y1) * (y3 - y1));
    double s = (ab + bc + ca) * 0.5;
    double S = sqrt(s * (s - ab) * (s - bc) * (s - ca));
    return S;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    double x1, y1, x2, y2, x3, y3, xp, yp;
    while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
        double abc = check(x1, y1, x2, y2, x3, y3);
        double abp = check(x1, y1, x2, y2, xp, yp);
        double bcp = check(x2, y2, x3, y3, xp, yp);
        double cap = check(x3, y3, x1, y1, xp, yp);
        double var = abc - (abp + bcp + cap);
        if(var <= 0.001 && var >= -0.001){
            cout << "YES" << endl;
        }
        else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define EPS (1e-10)
#define rep(i,n) for(int i=0;i<n;i++)
typedef complex<double> P;

double x,y,xx,yy,xxx,yyy,xxxx,yyyy;

double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}

int isInsected(P a1, P a2, P b1, P b2) {
  return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
         ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}

int main(){
	while(cin>>x>>y>>xx>>yy>>xxx>>yyy>>xxxx>>yyyy){
		P a=P(x,y),b=P(xx,yy),c=P(xxx,yyy),p=P(xxxx,yyyy);
		int C=!isInsected(a,b,c,p)&&!isInsected(b,c,a,p)&&!isInsected(c,a,b,p);
		cout<<(C?"YES":"NO")<<endl;
	}
}

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

using namespace std;

double EPS = 1e-10;

double add(double a, double b) {
	if (abs(a + b) < EPS * (abs(a) + abs(b))) {
		return 0;
	}
	return a + b;
}

struct P {
	double x, y;
	P() {}
	P(double x, double y) : x(x), y(y) {
	}
	P operator + (P p) {
		return P(add(x, p.x), add(y, p.y));
	}
	P operator - (P p) {
		return P(add(x, -p.x), add(y, -p.y));
	}
	P operator * (double d) {
		return P(x * d, y * d);
	}
	double dot(P p) {
		return add(x * p.x, y * p.y);
	}
	double det(P p) {
		return add(x * p.y, -y * p.x);
	}
};

bool cmp_x(const P& p, const P& q) {
	if (p.x != q.x) {
		return p.x < q.x;
	}
	return p.y < q.y;
}

vector<P> convex_hull(P* ps, int n) {
	sort(ps, ps + n, cmp_x);
	int k = 0;
	vector<P> qs(n * 2);

	for (int i = 0; i < n; i++) {
		while (k > 1 && (qs[k-1] - qs[k-2]).det(ps[i] - qs[k-1]) <= 0) {
			k--;
		}
		qs[k++] = ps[i];
	}
	for (int i = n-2, t = k; i >= 0; i--) {
		while (k > t && (qs[k-1] - qs[k-2]).det(ps[i] - qs[k-1]) <= 0) {
			k--;
		}
		qs[k++] = ps[i];
	}
	qs.resize(k-1);
	return qs;
}

P ps[10];

int main() {
	while (cin >> ps[0].x >> ps[0].y >> ps[1].x >> ps[1].y >> ps[2].x >> ps[2].y >> ps[3].x >> ps[3].y) {
		P pp = ps[3];
		vector<P> qs = convex_hull(ps, 4);
		if (qs.size() == 4) {
			cout << "NO" << endl;
		} else {
			bool hantei = true;
			for (int i = 0; i < 3; i++) {
				if (qs[i].x == pp.x && qs[i].y == pp.y) {
					hantei = false;
					break;
				}
			}
			if (hantei) {
				cout << "YES" << endl;
			} else {
				cout << "NO" << endl;
			}
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  double a,b,c,d,e,f,x,y;
  double s,t;

  while(cin>>a>>b>>c>>d>>e>>f>>x>>y){
    s=((e-d)*(x-c)-(e-c)*(y-d))/((a-c)*(e-d)-(e-c)*(b-d));
    t=((a-c)*(y-d)-(b-d)*(x-c))/((a-c)*(e-d)-(e-c)*(b-d));

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