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<stdio.h>
#include<iostream>
using namespace std;

double outer_product_z(double X[], double Y[]){
	return X[0]*Y[1]-X[1]*Y[0];
}
double x[4], y[4];
int main(){
	while(1){
		for(int i=0;i<4;i++){
			cin >> x[i] >> y[i];
		}
		
		double vec_ap[2] = {(x[3]-x[0]),(y[3]-y[0])};
		double vec_bp[2] = {(x[3]-x[1]),(y[3]-y[1])};
		double vec_cp[2] = {(x[3]-x[2]),(y[3]-y[2])};
		double vec_ab[2] = {(x[1]-x[0]),(y[1]-y[0])};
		double vec_bc[2] = {(x[2]-x[1]),(y[2]-y[1])};
		double vec_ca[2] = {(x[0]-x[2]),(y[0]-y[2])};

		if((outer_product_z(vec_ap,vec_ab)>0&&outer_product_z(vec_bp,vec_bc)>0&&outer_product_z(vec_cp,vec_ca)>0) || (outer_product_z(vec_ap,vec_ab)<0&&outer_product_z(vec_bp,vec_bc)<0&&outer_product_z(vec_cp,vec_ca)<0)) cout << "Yes" << endl;
		else cout << "No" << endl;

		if(cin.eof()) return 0;	
	}

}

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

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;

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

		double l1_x = (y2 - y3);
		double l1_y = -(x2 - x3);
		double l1_c = -(y2 - y3)*x3 + y3;
		
		double l2_x = (y1 - y3);
		double l2_y = -(x1 - x3);
		double l2_c = -(y1 - y3)*x3 + y3;

		double l3_x = (y1 - y2);
		double l3_y = -(x1 - x2);
		double l3_c = -(y1 - y2)*x2 + y2;

		int sign = 	(l1_x * xp + l1_y * yp + l1_c)*l1_c *
					(l2_x * xp + l2_y * yp + l2_c)*l2_c *
					(l3_x * xp + l3_y * yp + l3_c)*l3_c;
		if (sign >= 0)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

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

void couten(double x[], double y[], double &cx, double &cy){
	double a2, b2, c2, a, b, c, s, S2;
	a2 = abs((x[2]-x[1])*(x[2]-x[1]) + (y[2]-y[1])*(y[2]-y[1]));
    b2 = abs((x[0]-x[2])*(x[0]-x[2]) + (y[0]-y[2])*(y[0]-y[2]));
    c2 = abs((x[1]-x[0])*(x[1]-x[0]) + (y[1]-y[0])*(y[1]-y[0]));
    a = sqrt(a2); b = sqrt(b2); c = sqrt(c2);
	if((a + b + c) == 0){
		s = 0;
		cx = 0;
		cy = 0;
	} else{
		s = (a + b + c) / 2;S2 = s * (s-a) * (s-b) * (s-c);
		cx = (a2*(b2+c2-a2)*x[0] + b2*(c2+a2-b2)*x[1] + c2*(a2+b2-c2)*x[2]) / (16 * S2);
		cy = (a2*(b2+c2-a2)*y[0] + b2*(c2+a2-b2)*y[1] + c2*(a2+b2-c2)*y[2]) / (16 * S2);
	}
}

int hantei(double x[], double y[], double &cx, double &cy, double xp, double yp){
	bool flag[3];
	double tc, tp, tcc, tpp;
	x[3] = x[0]; y[3] = y[0];
	for(int i = 0; i < 3; i++){
		tc = (x[i] - x[i + 1]) * (cy - y[i]) + (y[i] - y[i + 1]) * (x[i] - cx);
		tp = (x[i] - x[i + 1]) * (yp - y[i]) + (y[i] - y[i + 1]) * (x[i] - xp);
		if(tc * tp >= 0){
			flag[i] = true;
		} else{
			continue;
		}
	}
	if(flag[0] == true && flag[1] == true && flag[2] == true){
		return 1;
	} else{
		return 0;
	}
}


int main(){
	double x[3], y[3], xp, yp, cxx, cyy;
	double &cx = cxx, &cy = cyy;
	
	while(cin >>x[0] >>y[0] >>x[1] >>y[1] >>x[2] >>y[2] >>xp >>yp){
		couten(x, y, cx, cy);
		if(hantei(x, y, cx, cy, xp, yp)){
			cout <<"YES"<<endl;
		} else{
			cout <<"NO"<<endl;
		}
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define X real()
#define Y imag()
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using comd = complex<double>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(all(v),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

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 norm(){
    return sqrt(x*x + y*y);
  }
  double dot(P p){
    return add(x * p.x,y*p.y);
  }
  double det(P p){
    return add(x*p.y,-y*p.x);
  }
  double dist2(P p){
    return ((*this-p).x * (*this-p).x) + ((*this-p).y * (*this-p).y);
  }
  double GetSlope(P &p){
    P tmp = *this - p;
    return tmp.y/tmp.x;
  }
};
//????????????????????????¨?????????
bool on_seg(P p1,P p2,P q){
  return (p1-q).det(p2-q) == 0 && (p1-q).dot(p2-q) <= 0;
}

bool check(P p1,P p2,P p3, P p4){
  P a = p1 - p2,b = p3 - p2, p = p4 - p2;
  double theta1 = acos(a.dot(b)/(a.norm() * b.norm()));
  double theta2 = acos(b.dot(a)/(a.norm() * b.norm()));
  double thetap = acos(a.dot(p)/(a.norm() * p.norm()));
  double thetaq = acos(b.dot(p)/(a.norm() * p.norm()));
  //   debug(theta1);
  //   debug(theta2);
  //   debug(thetap);
  //   debug(thetaq);
  return thetap <= theta1 && thetaq <= theta1;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double a,b,c,d,e,f,xp,yp;
  while(cin >> a >> b >> c >> d >> e >> f >> xp >> yp){
    bool flag = true;
    //     double acx = c-a,abx = e-a,acy = d-b,aby = f-b,apx = xp-a,apy = yp - b;
    P p1 = P(a,b),p2 = P(c,d),p3 = P(e,f),p4 = P(xp,yp);
    Ans(check(p1,p2,p3,p4) && check(p1,p3,p2,p4) && check(p3,p1,p2,p4));
  }
  return 0;
}