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++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl;
typedef long long ll;
typedef unsigned long long ull;

double v_pro(double a[], double b[])
{
    return a[0] * b[1] - a[1] * b[0];
}

int main()
{
    double v[3][2], p[2];
    while (cin >> v[0][0] >> v[0][1] >> v[1][0] >> v[1][1] >> v[2][0] >> v[2][1] >> p[0] >> p[1])
    {
        double w[3][2];

        rep(i, 3)
        {
            rep(j, 2)
            {
                w[i][j] = p[j] - v[i][j];
            }
        }

        if ((v_pro(w[0], w[1]) > 0 && v_pro(w[1], w[2]) > 0 && v_pro(w[2], w[0]) > 0) || (v_pro(w[0], w[1]) < 0 && v_pro(w[1], w[2]) < 0 && v_pro(w[2], w[0]) < 0))
        {
            OP("YES")
        }
        else
        {
            OP("NO")
        }
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
double x[4], y[4];
double f(int a, int b, int c)
{
	return ((y[c]-y[a])*(x[b]-x[a])-(y[b]-y[a])*(x[c]-x[a]));
}
int main()
{
	while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3])
	{
		if (f(0, 1, 2)*f(0, 1, 3) > 0 && f(1, 2, 0)*f(1, 2, 3) > 0 && f(2, 0, 1)*f(2, 0, 3) > 0)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<math.h>

using namespace std;

typedef long long int lli;

int main()
{
	double x1, x2, x3, xp;
	double y1, y2, y3, yp;
	double abc[3];
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		abc[0] = (x3 - x2)*(yp - y2) - (y3 - y2)*(xp - x2);
		abc[1] = (x1 - x3)*(yp - y3) - (y1 - y3)*(xp - x3);
		abc[2] = (x2 - x1)*(yp - y1) - (y2 - y1)*(xp - x1);
		if ((abc[0] > 0 && abc[1] > 0 && abc[2] > 0) || (abc[0] < 0 && abc[1] < 0 && abc[2] < 0)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

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

using namespace std;
#define EPS (1e-10)
#define ABS(x) ((x)<0?-(x):(x))
struct L{
    L(double xa, double ya, double xb, double yb){
	x1 = xa;
	y1 = ya;
	x2 = xb;
	y2 = yb;
	if(xa-xb == 0){
	    a = 1;
	    b = 0;
	    c = -xa;
	}
	else {
	    a = (ya-yb);
	    b = (xb-xa);
	    c = -(a*xa + b*ya);
	}
    };
    double f(double x, double y){
	return a*x + b*y + c;
    }
    double a, b, c, x1, x2, y1, y2;//0 = ax + by + c [x1, x2]
};

bool cross(L a, L b){
    return (a.f(b.x1, b.y1) * a.f(b.x2, b.y2) < 0 && 
	    b.f(a.x1, a.y1) * b.f(a.x2, a.y2) < 0);
}

double x1, y1, x2, y2, x3, y3, xp, yp;

int main(){
    while(cin){
	cin >> x1 >> y1 >> x2 >> y2>> x3 >> y3 >> xp >> yp;
	L a = L(x1, y1, x2, y2);
	L b = L(x1, y1, x3, y3);
	L c = L(x2, y2, x3, y3);
	L p = L(xp, yp, 102.131921, 103.141592);
	int res = 0;
	if(cross(a,p))res++;
	if(cross(b,p))res++;
	if(cross(c,p))res++;
	if(res % 2 == 0)cout << "NO" <<  endl;
	else cout << "YES"<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cmath>
#define mul(s, t) ((s-t)*(s-t))

using namespace std;

int main()
{
	double x[3], y[3], u[2], s, t, v;
	
	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> s >> t){
		bool f = true;
		for(int i = 0; i < 3; i++){
			int p = 0;
			for(int j = 0; j < 3; j++){
				if(i != j){
					u[p++] = sqrt(mul(x[i], x[j])+mul(y[i], y[j]));
				}
			}
			v = sqrt(mul(x[i], s)+mul(y[i], t));
			
			if(u[0] <= v && u[1] <= v){
				f = false;
				break;
			}
		}
		cout << ((f)? "YES" : "NO") << endl;
	}
	
	return 0;
}

C++: #include<iostream>
#include<complex>
using namespace std;
typedef complex<double> P;
#define EPS 1.0e-12
#define F(I,J,N) for(int I=J;I<N;I++)

class Line{
public:
	P p[2];
	P v;
	Line(){}
	Line(P p0,P p1){
		p[0]=p0;
		p[1]=p1;
		v=p1-p0;
	}
	//線分の長さ
	double length(){return abs(v);}
	//平行
	bool Parallel(Line l){
		return (cross(v,l.v)==0);
	}
	//線分上
	bool OnLine(P a){
		return (abs(p[0]-a)+abs(a-p[1])<length()+EPS);
	}
	double cross(Line l){
		return cross(v,l.p[0]-p[0]) * cross(v,l.p[1]-p[0]);
	}
	double cross(P a,P b){
		return (real(a)*imag(b)-imag(a)*real(b));
	}
	bool Intersection(Line l){
		if(Parallel(l)){
			return (OnLine(l.p[0])||OnLine(l.p[1])||l.OnLine(p[0])||l.OnLine(p[1]));
		}
		return ((cross(l)<EPS) && (l.cross(*this))<EPS);
	}
};

class Pi{
private:
	P *p;
	Line *l;
	int n;
public:
	Pi(){}
	Pi(int n){
		this->n=n;
		p=new P[n+1];
		l=new Line[n];
	}
	~Pi(){
		delete []p;
		delete []l;
	}
	void set(int i,P a){
		if(i==0){
			p[0]=a;
			p[n]=a;
		}
		else p[i]=a;
	}
	void set(){
		F(i,0,n) l[i]=Line(p[i],p[i+1]);
	}
	bool isin(P a){
		F(i,0,n) if(l[i].OnLine(a)) return true;
		int cnt=0;
		Line buf(a,P(-101,-101));
		F(i,0,n) if(l[i].Intersection(buf)) cnt++;
		if(cnt&1) return true;
		return false;
	}
};

int main(){
	double a,b,c,d,e,f,g,h;
	P p[3],q;
	Pi *in;
	while(cin>>a>>b>>c>>d>>e>>f>>g>>h){
		p[0]=P(a,b);
		p[1]=P(c,d);
		p[2]=P(e,f);
		q=P(g,h);
		in=new Pi(3);
		F(i,0,3) in->set(i,p[i]);
		in->set();
		if(in->isin(q)) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
		delete in;
	}
	return 0;
}

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

constexpr double pi = 3.14159265358979323846;

struct vec2d
{
    double x, y;

    double dot(vec2d const & other)
    {
        return x * other.x + y * other.y;
    }

    double norm()
    {
        return sqrt(x * x + y * y);
    }
};

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

    vec2d v12, v23, v31;
    vec2d v1p, v2p, v3p;
    double a121p, a232p, a313p;

    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        v12 = vec2d{x2 - x1, y2 - y1};
        v23 = vec2d{x3 - x2, y3 - y2};
        v31 = vec2d{x1 - x3, y1 - y3};

        v1p = vec2d{xp - x1, yp - y1};
        v2p = vec2d{xp - x2, yp - y2};
        v3p = vec2d{xp - x3, yp - y3};

        a121p = acos(v12.dot(v1p) / (v12.norm() * v1p.norm()));
        a232p = acos(v23.dot(v2p) / (v23.norm() * v2p.norm()));
        a313p = acos(v31.dot(v3p) / (v31.norm() * v3p.norm()));

        if (a121p <= pi / 2 && a232p <= pi / 2 && a313p <= pi / 2) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

    return 0;
}