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++: #include <iostream>
#include <complex>
#include <vector>
#include <cstdio>
using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;

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);
}
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

int main() {
  double x1,y1,x2,y2,x3,y3, x, y;
  while(cin >> x1) {
    cin >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y;
    P a1(x1,y1), a2(x2,y2), a3(x3,y3), a(x,y);

    if (ccw(a1,a2,a)==1 && ccw(a2,a3,a)==1 && ccw(a3, a1, a)==1)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
}

C++: #include<iostream>
#include<math.h>

using namespace std;

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	double l1,l2,l3,l,pl;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		l1=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
		l2=sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
		l3=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
		if(l1+l2>l2+l3){
			if(l2+l3>l3+l1)l=l3+l1;
			else l=l2+l3;
		}else{
			l=l1+l2;
		}
		pl=sqrt((xp-x1)*(xp-x1)+(yp-y1)*(yp-y1))+sqrt((xp-x2)*(xp-x2)+(yp-y2)*(yp-y2))+sqrt((xp-x3)*(xp-x3)+(yp-y3)*(yp-y3));
		if(pl>l)cout<<"NO"<<endl;
		else cout<<"YES"<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
bool cross(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy) {
	double ta = (cx - dx) * (ay - cy) + (cy - dy) * (cx - ax);
	double tb = (cx - dx) * (by - cy) + (cy - dy) * (cx - bx);
	double tc = (ax - bx) * (cy - ay) + (ay - by) * (ax - cx);
	double td = (ax - bx) * (dy - ay) + (ay - by) * (ax - dx);
	return tc * td <= 0 && ta * tb <= 0;
}
signed main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while( scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF ){
		double xc = ( x1 + x2 + x3 )/3;
		double yc = ( y1 + y2 + y3 )/3;
		if (cross(x1, y1, x2, y2, xc, yc, xp ,yp) ||
				cross(x2, y2, x3, y3, xc, yc, xp ,yp) ||
				cross(x3, y3, x1, y1, xc, yc, xp ,yp)){
			cout << "NO" << endl;
		}else cout << "YES" << endl;
	}
	return 0;
}

C++: #define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()
const int INF = 1e9;
const double PI = 3.14159;
int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
using namespace std;
typedef long long ll;
//typedef pair<int, int> P;

/* struct P {
	int x, y, n;
	P(int n, int x, int y):n(n), x(x), y(y){}
	P(){}
}; */


/** 幾何ライブラリ **/
#include <complex>

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

const double EPS = 1e-11;

typedef double D;
typedef complex<D> P; // Point

struct L { // Line
	P a, b;
	L(){}
	L(P aa, P bb) : a(aa), b(bb){}
};

// 共役複素数 conj(a);

// 符号
int sig(D a, D b=0) { return a < b - EPS ? -1 : (a > b + EPS ? 1 : 0); }

// 内積
D dot(P a, P b) { return (conj(a)*b).real(); }

// 外積
D cross(P a, P b) { return (conj(a)*b).imag(); }

// 線分abに対する点cの位置
enum STATE{LEFT=1, RIGHT=-1, BACK=2, FRONT=-2, ON=0, IN=3, OUT=-3};
int ccw(P a, P b, P c)
{
	b -= a, c -= a;
	D s = sig(cross(b, c));
	if (s) return s>0 ? LEFT : RIGHT;
	if (sig(dot(b, c))<0) return BACK;
	if (sig(abs(c), abs(b))>0) return FRONT;
	return ON;
}

// 直線lに対する点pの写像
P projection(L l, P p)
{
	return l.a + (l.b-l.a)/abs(l.b-l.a) * dot(l.b-l.a, p-l.a)/abs(l.b-l.a);
}

// 直線lに対する点pの反射
P reflection(L l, P p)
{
	return p + (projection(l, p)-p)*P(2, 0);
}

// 直線abと点cの距離
D dLP(L l, P c)
{
	return abs(cross(l.b-l.a, c-l.a))/abs(l.b-l.a);
}

// 線分abと点cの距離
D dSP(L l, P c)
{
	if (sig(dot(l.b-l.a, c-l.a))<0) return abs(c-l.a);
	if (sig(dot(l.a-l.b, c-l.b))<0) return abs(c-l.b);
	return abs(cross(l.b-l.a, c-l.a))/abs(l.b-l.a);
}

// 線分と線分の交差判定
bool iSS(L s, L t)
{
	return (ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0)
			&& (ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0);
}

// 線分と線分の距離
D dSS(L s, L t)
{
	if (iSS(s, t)) return 0;
	return min(min(dSP(t, s.a), dSP(t, s.b)), min(dSP(s, t.a), dSP(s, t.b)));
}

// 線分と線分の交点 (公差していることが前提)
P cSS(L s, L t)
{
	D d1 = dLP(t, s.a);
	D d2 = dLP(t, s.b);
	D tmp = d1 / (d1 + d2);
	return s.a + (s.b-s.a)*tmp;
}

// 直線と直線の交差判定
bool iLL(L s, L t)
{
	return sig(cross(s.b-s.a, t.b-t.a))!=0;
}

// 直線と直線の交点 iLLを確認してから使用
P cLL(L s, L t)
{
	P ss = s.b - s.a, tt = t.b - t.a;
	return s.a + ss*cross(tt, t.a-s.a)/cross(tt, ss);
}

// 多角形
typedef vector<P> G;
#define GET(v, i) v[i%v.size()]

int containsGP(G g, P p)
{
	bool in=false;
	for (int i=0; i<g.size(); i++) {
		P a = GET(g, i)-p, b = GET(g, i+1)-p;
		if (ccw(a, b, p) == ON) return ON;
		if (a.Y > b.Y) swap(a, b);
		if (a.Y<0 && b.Y>=0 && sig(cross(a, b))>0) in = !in;
	}
	return in?IN:OUT;
}

/** Problem0012 : A Point In Triangle **/
int main()
{
	P a, b, c, p;
	while (cin>>a.X>>a.Y>>b.X>>b.Y>>c.X>>c.Y>>p.X>>p.Y) {
		G g;
		g.push_back(a);
		g.push_back(b);
		g.push_back(c);
		cout << (containsGP(g, p)==IN?"YES":"NO") << endl;
	}
}

C++: //template
//include-------------------------------------
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<stack>

using namespace std;

//typedef--------------------------------------
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

#define MP make_pair

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

//constant-------------------------------------
const double PI = acos(-1.0);

//cout,cin-------------------------------------
#define COUT(x) cout<<(x)<<endl
#define CIN(x) cin>>(x)

int main(){

	double x1, y1, x2, y2, x3, y3, xp, yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){

		//A点を原点に移動
		x2 -= x1; y2 -= y1;
		x3 -= x1; y3 -= y1;
		xp -= x1; yp -= y1;

		double k1, k2;
		if (x2 != 0){
			k2 = (yp - (xp / x2)*y2) / (y3 - (x3 / x2)*y2);
			k1 = (xp - k2*x3) / x2;
		}
		else{
			k1 = (xp - (yp / y2)*x2) / (x3 - (y3 / y2)*x2);
			k2 = (yp - k1*y3) / y2;
		}

		if ((k1 > 0) && (k2 > 0) && (k1 + k2 < 1)) COUT("YES");
		else COUT("NO");
	}

	return 0;

}