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 "bits/stdc++.h"
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)



#define EPS (1e-10)
class P{                    //???
public:
    double x,y;
    
    P(double _x=0,double _y=0):x(_x),y(_y){};
    P operator + (P &p     ){ return P( x+p.x , y+p.y ); }  //??????
    P operator - (P &p     ){ return P( x-p.x , y-p.y ); }  //??????
    P operator * (double k ){ return P( x*k   , y*k    ); } //??????
    P operator / (double k ){ return P( x/k   , y/k    ); } //??????
    
    bool operator == (const P &p){ return ( fabs(x-p.x)<EPS && fabs(y-p.y)<EPS ); }
    //    bool operator < (const P &p)const{ return ( x!=p.x ? x<p.x:y<p.y ); }
    
    double norm(){ return x*x+y*y; }        //?????????
    double abs() { return sqrt(norm()); }   //??§??????
    
};
struct L{P p1,p2;};         //??´???
typedef vector<P> Polygon;  //????§???¢
typedef P Vector;           //????????????

double dot  (Vector a,Vector b){ return a.x*b.x+a.y*b.y; }
double cross(Vector a,Vector b){ return a.x*b.y-a.y*b.x; }

int ccw(P p0,P p1,P p2){    //AOJ_BOOK_P386 verified
    Vector a = p1 - p0;
    Vector b = p2 - p0;
    
    if( cross(a,b) > EPS  ) return 1 ;      //COUNTER_CLOCKWISE
    if( cross(a,b) < -EPS ) return -1;      //CLOCKWISE
    if( dot(a,b)   < -EPS ) return 2;       //ONLINE_BACK
    if( a.norm()   < b.norm() ) return -2;  //ONLINE_FRONT
    
    return 0;                               //ON_SEGMENT;
}

//?????????????????? verified
bool intersect(P p1,P p2,P p3,P p4){ return ( ccw(p1,p2,p3)*ccw(p1,p2,p4)<=0 && ccw(p3,p4,p1)*ccw(p3,p4,p2)<=0 ); }

//????????¨???????????¢ verified ARC042-B
double distance_l_p(L l, P p) { return abs(cross(l.p2-l.p1, p-l.p1)) /(l.p2-l.p1).abs(); }

//????????¨??????????????????(????????£???????????´??????????????±???)
bool intersect_circle_point(P center, double r, L line){
    if( distance_l_p(line,center) <= r+EPS ) return true;
    return false;
}


//????´?????§???¢??????
bool isSimple( Polygon pol ){
    //???????????????????????????pol?????\????????????
    size_t pol_size = pol.size()-1;
    rep(i,pol_size){
        for(int j=i+2;j<pol_size;j++){
            if( i==j || i==(j-1+pol_size)%pol_size || i==(j+1+pol_size)%pol_size )continue;
            if( intersect(pol[i], pol[i+1], pol[j], pol[j+1]) )return false;
        }
    }
    return true;
}


//?????????????§???¢????????´?????????????????????????±??????? true???????????´ verified AOJ0012
bool isPointInsidePolygon(vector<L> side,P p){
    int c=0, sideSum=side.size();
    
    rep(i,sideSum){
        if( cross(side[i].p2-side[i].p1,p-side[i].p1)>0 ) c++;
    }
    return !(c%sideSum);
}


int main(){
    double a,b,c,d,e,f,g,h;
    while(cin>>a>>b>>c>>d>>e>>f>>g>>h){
        vector<L> angle;
        angle.pb( L{P(a,b),P(c,d)} );
        angle.pb( L{P(c,d),P(e,f)} );
        angle.pb( L{P(e,f),P(a,b)} );
        
        if(isPointInsidePolygon(angle,P(g,h))){
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
    }
    
    
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <cstdlib>
#include <queue>
#include <vector>
#include <set>
#include <stdio.h>
#include <cstdio>
#include <cmath>
#include <complex> 
using namespace std;
typedef complex<double> xy_t;
xy_t P[4];
double x,y;
double a,b,c;
int main() {
	int i=0;
while (cin >> x >> y) {
	P[i] = xy_t(x,y);
	i += 1;
	if (i == 4) {
	a =  ((P[0]-P[3]).real()*(P[1]-P[3]).imag()-(P[0]-P[3]).imag()*(P[1]-P[3]).real())/2;
	b =  ((P[1]-P[3]).real()*(P[2]-P[3]).imag()-(P[1]-P[3]).imag()*(P[2]-P[3]).real())/2;
	c =  ((P[2]-P[3]).real()*(P[0]-P[3]).imag()-(P[2]-P[3]).imag()*(P[0]-P[3]).real())/2;
	bool p = a*b > 0 && b*c > 0;
cout << (p ? "YES" : "NO") << endl;
i = 0;
}
}
}

C++: #include <bits/stdc++.h>

using namespace std;

class D3
{
public:
	double x;
	double y;
	double z;

	//?????????????????????
	D3 ( double x_ = 0.0 , double y_ = 0.0 , double z_ = 0.0 )
	{
		x = x_;
		y = y_;
		z = z_;
	}

	//??????
	D3 Cross_product ( D3 partner )
	{
		D3 ret ( y*partner.z - z*partner.y , z*partner.x - x*partner.z , x*partner.y - y*partner.x );
		return ret;
	}

	//??????
	double Inner_product ( D3 partner )
	{
		return x*partner.x + y*partner.y + z*partner.z;
	}

	//?????????????????????????????????
	D3 Make_vector ( D3 partner )
	{
		D3 ret ( partner.x - x , partner.y - y , partner.z - z );
		return ret;
	}

	//???????§????2????????????????????¢???????±???????
	double S_vec ( D3 A , D3 B )
	{
		D3 G;
		G = A.Cross_product ( B );
		return sqrt ( G.Inner_product ( G ) ) / 2;
	}

	//??????????????¢???????±???????
	double S_point ( D3 A , D3 B , D3 C )
	{
		return S_vec ( A.Make_vector ( B ) , A.Make_vector ( C ) );
	}

	//???????§????3????????????????????????????±???????
	double V_vec ( D3 A , D3 B , D3 C )
	{
		D3 G;
		G = A.Cross_product ( B );
		return G.Inner_product ( C ) / 6;
	}

	//4???????????????????±???????
	double V_point ( D3 A , D3 B , D3 C , D3 D )
	{
		return V_vec ( A.Make_vector ( B ) , A.Make_vector ( C ) , A.Make_vector ( D ) );
	}

	D3 operator+( D3 partner )
	{
		return D3 ( x + partner.x , y + partner.y , z + partner.z );
	}

	D3 operator-( D3 partner )
	{
		return D3 ( x - partner.x , y - partner.y , z - partner.z );
	}

	D3 operator*( D3 partner )
	{
		return D3 ( x * partner.x , y * partner.y , z * partner.z );
	}

	D3 operator/( D3 partner )
	{
		return D3 ( x / partner.x , y / partner.y , z / partner.z );
	}

	D3 operator*( double d )
	{
		return D3 ( x * d , y * d , z * d );
	}

	D3 operator/( double d )
	{
		return D3 ( x / d , y / d , z / d );
	}

	bool operator==( D3 partner )
	{
		return x == partner.x&&y == partner.y&&z == partner.z;
	}

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

	//???????????????????????????
	//????????¨???
	D3 Unit_vec ()
	{
		return D3 ( *this ) / ( *this ).length ();
	}

	//????????????????????????
	D3 Inverse_vec ()
	{
		return D3 ( *this )*-1;
	}

	//?????´????????????
	bool Vertical ( D3 partner )
	{
		return ( *this ).Inner_product ( partner ) == 0;
	}

	//??????????????????
	bool Parallel ( D3 partner )
	{
		return ( *this ).Unit_vec () == partner.Unit_vec () || ( *this ).Unit_vec ().Inverse_vec () == partner.Unit_vec ();
	}

};

int main ()
{
	double x1 ,y1, x2, y2, x3, y3, xp, yp;
	while( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp )
	{
		D3 X ( x1 , y1 ) , Y ( x2 , y2 ) , Z ( x3 , y3 ) , P ( xp , yp ),calc;
		if( calc.S_point ( X , Y , Z ) == calc.S_point ( X , Y , P ) + calc.S_point ( X , Z , P ) + calc.S_point ( Z , Y , P ) )
		{
			cout << "YES" << endl;
		} else
		{
			cout << "NO" << endl;
		}
	}

}