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 _USE_MATH_DEFINES
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <memory>
#include <string>

#include <algorithm>
#include <complex>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#define __typeof__ decltype
#endif

#define ITER(c)         __typeof__((c).begin())
#define FOREACH(it, c)  for (ITER(c) it=(c).begin(); it != (c).end(); ++it)
#define RITER(c)        __typeof__((c).rbegin())
#define RFOREACH(it, c) for (RITER(c) it=(c).rbegin(); it != (c).rend(); ++it)
#define REP(i, n)       REPEAT(i, 0, n)
#define REPEAT(i, k, n) for (int i = (k); i < (n); ++i)
#define REVREP(i, n)    for (int i = ((n)-1); i >= 0; --i)
#define ESIZEOF(A)      (sizeof(A)/sizeof((A)[0]))
#define MIN(p1,p2)      (((p1)<(p2))?(p1):(p2))
#define MAX(p1,p2)      (((p1)>(p2))?(p1):(p2))
#define CIN_NO_SYNC     do { cin.tie(0); ios_base::sync_with_stdio(false); } while(0)

#define X real()
#define Y imag()
typedef double D;
typedef complex<double>P;

D inprd(const P &a, const P &b){ return (conj(a) * b).X; }
D outprd(const P &a, const P &b){ return (conj(a) * b).Y; }
D sign(D d){ return (d<0)?-1:d>0?1:0; }
 
int main(void){
    CIN_NO_SYNC;
    double x1,y1,x2,y2,x3,y3,xp,yp;
    while(cin >>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
        P p12(x2-x1,y2-y1), p23(x3-x2,y3-y2), p31(x1-x3,y1-y3);
        P p1p(xp-x1,yp-y1), p2p(xp-x2,yp-y2), p3p(xp-x3,yp-y3);
        if(sign(outprd(p12, p1p)) == sign(outprd(p23, p2p)) && sign(outprd(p23, p2p)) == sign(outprd(p31, p3p))){
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
signed main() {
	double x1, x2, x3, x4, y1, y2, y3, y4;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4)cout << ((((x1 - x2) * (y4 - y1) - (y1 - y2) * (x4 - x1)) * ((x1 - x2) * (y3 - y1) - (y1 - y2) * (x3 - x1)) > 0) && (((x2 - x3) * (y4 - y2) - (y2 - y3) * (x4 - x2)) * ((x2 - x3) * (y1 - y2) - (y2 - y3) * (x1 - x2)) > 0) && (((x3 - x1) * (y4 - y3) - (y3 - y1) * (x4 - x3)) * ((x3 - x1) * (y2 - y3) - (y3 - y1) * (x2 - x3)) > 0) ? "YES\n" : "NO\n");
}

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

double x[4],y[4];
string judge ();

int main() {
	while ( cin >> x[0] ) {
		for( int i = 0; i < 4; i++ ){
			if ( !i )
				cin >> y[i];
			else
				cin >> x[i] >> y[i];
		}
		
		cout <<  judge () << endl;
		
	}
	return 0;
}

string judge () {
	string res;
	double a,b;
	int n,nn;
	
	for ( int i = 0; i < 3; i++ ) {
		if ( i == 2 ){
			n = '0';
			nn = n + 1;
		}else if ( i == 1 ){
			n = i + 1;
			nn = '0';
		}else{
			n = i + 1;
			nn = n + 1;
		}
		
		if ( x[n] != x[i] ){
			a = (y[n] - y[i]) / (x[n] - x[i]);
			b = (x[i] * y[n] - x[n] * y[i]) / (x[i] - x[n]);
		} else {
			a = '0';
			b = y[i];
		}
		if ( (a * x[3] + b) > y[3] && (a * x[nn] + b) < y[nn] || (a * x[3] + b) < y[3] && (a * x[nn] + b) > y[nn] ) {
			return "NO";
		}
	}
	return "YES";
	
}

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

const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);

using Point = complex<double>;
using Polygon = vector<Point>;

inline int sgn(const double &a) { return (a < -EPS ? -1 : (a > EPS ? 1 : 0)); }

inline bool eq(const Point &a, const Point &b) { return abs(a - b) < EPS; }

inline bool operator<(const Point &a, const Point &b){
    if (sgn(a.real() - b.real()))
        sgn(a.real() - b.real()) < 0;
    return sgn(a.imag() - b.imag());
}

double dot(const Point &a, const Point &b) { return real(conj(a) * b); }

double det(const Point &a, const Point &b) { return imag(conj(a) * b); }

struct Line {
    Point p1, p2;

    Line(Point p1 = Point(), Point p2 = Point()) : p1(p1), p2(p2) {}

    bool operator<(const Line &rhs) const {
        if (eq(p2, rhs.p2))
            return p1 < rhs.p1;
        return p2 < rhs.p2;
    }
    bool operator==(const Line &rhs) const {
        return (eq(p1, rhs.p1) && eq(p2, rhs.p2)) ||
               (eq(p1, rhs.p2) && eq(p2, rhs.p1));
    }
};

bool is_in_a_triangle(Point a, Point b, Point c, Point p){
    double c1 = det(b-a, p-a);
    double c2 = det(c-b, p-b);
    double c3 = det(a-c, p-c);
    if(sgn(c1) == sgn(c2) && sgn(c2) == sgn(c3) && sgn(c1) != 0) return true;
    else return false;
}

int 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){
        if(is_in_a_triangle(Point(x1,y1),Point(x2,y2),Point(x3,y3),Point(xp,yp)))cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    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 xab = x2 - x1;
        double xbp = xp - x2;
        double xbc = x3 - x2;
        double xcp = xp - x3;
        double xca = x1 - x3;
        double xap = xp - x1;

        double yab = y2 - y1;
        double ybp = yp - y2;
        double ybc = y3 - y2;
        double ycp = yp - y3;
        double yca = y1 - y3;
        double yap = yp - y1;

        double za = xab * ybp - yab * xbp;
        double zb = xbc * ycp - ybc * xcp;
        double zc = xca * yap - yca * xap;

        if ((za < 0 && zb < 0 && zc < 0) || (za > 0 && zb > 0 && zc > 0)) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }

        if (cin.eof()) break;
    }

    return 0;
}

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

using namespace std;

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

	while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
		calc1 = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1);
		calc2 = (x3 - x2) * (yp - y2) - (y3 - y2) * (xp - x2);
		calc3 = (x1 - x3) * (yp - y3) - (y1 - y3) * (xp - x3);

		if ((calc1 > 0 && calc2 > 0 && calc3 > 0) || (calc1 < 0 && calc2 < 0 && calc3 < 0)) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	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 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=cross(p-a,b-a)>0&&cross(p-b,c-b)>0&&cross(p-c,a-c)>0||cross(p-a,b-a)<0&&cross(p-b,c-b)<0&&cross(p-c,a-c)<0;
		cout<<(C?"YES":"NO")<<endl;
	}
}