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 <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef vector<PII> VPII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for ( auto &v : c )
#define EACH( it, c ) for ( auto it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define DRANGE( c, p ) (c).begin(), (c).begin() + p, (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

#include <complex>
typedef complex<double> Point;
const double EPS = 1e-8;

// テ・ツ?・テ・ツ環崚」ツつケテ」ツδ暗」ツδェテ」ツδシテ」ツδ?」ツ?凝」ツつ嘉・ツョツ淌ヲツ閉ーテ、ツコツ古」ツ?、テ」ツつ津」ツ?ィテ」ツ?」テ」ツ?ヲ Point テ」ツ?ク
istream& operator >> ( istream &s, Point &a )
{
	double r, i;
	s >> r >> i;
	a = Point( r, i );
	return s;
}

// テ・ツ、ツ姪ァツゥツ催ッツシツ暗」ツつッテ」ツδュテ」ツつケテァツゥツ催ッツシツ?
double cross( const Point &a, const Point &b )
{
	return a.real() * b.imag() - a.imag() * b.real();
}

// CCW テゥツ鳴「テヲツ閉ーテ」ツ?? -> b -> c テ」ツ?ィテゥツ?イテ」ツつ?」ツ?ィテ」ツ?催」ツ??・ツ渉催ヲツ卍づィツィツ暗・ツ崢榲」ツつ甘」ツ?ェテ」ツつ?-1, テァツ崢エテゥツ?イテ」ツ?ェテ」ツつ?0, テヲツ卍づィツィツ暗・ツ崢榲」ツつ甘」ツ?ェテ」ツつ?1
int ccw( const Point &a, const Point &b, const Point &c )
{
	if ( cross( ( b - a ), ( c - a ) ) < -EPS )
	{
		return -1;
	}
	else if ( EPS < cross( ( b - a ), ( c - a ) ) )
	{
		return 1;
	}
	else
	{
		return 0;
	}
}

int main()
{
	cin.tie( 0 );
	ios::sync_with_stdio( false );

	for ( Point a, b, c, p; cin >> a >> b >> c >> p; )
	{
		vector<Point> ps( 4 );
		ps[0] = a;
		ps[1] = b;
		ps[2] = c;
		ps[3] = a;

		int sum = 0;
		REP( i, 0, 3 )
		{
			sum += ccw( ps[i], ps[ i + 1 ], p );
		}
		cout << ( abs( sum ) == 3 ? "YES" : "NO" ) << endl;
	}

	return 0;
}

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

class Point {
public:
    double x, y;
};

double dotProduct(Point p1, Point p2) {
    return p1.x * p2.y - p1.y * p2.x;
}

int main () {
    double x[4], y[4];
    while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3]) {
        double dp[3];
        for (int i = 0; i < 3; i++) {
            Point p[2];
            p[0].x = x[(i+1) % 3] - x[i];
            p[0].y = y[(i+1) % 3] - y[i];
            p[1].x = x[3] - x[i];
            p[1].y = y[3] - y[i];
            dp[i] = dotProduct(p[0], p[1]);
        }
        if ((dp[0] > 0 && dp[1] > 0 && dp[2] > 0)
            || (dp[0] < 0 && dp[1] < 0 && dp[2] < 0)) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}

C++: /*problem C*/

#include <iostream>
using namespace std;

typedef struct{
	double x,y;
}point_obj;

int isClossLine(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
	return ( (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}

int main(){
	point_obj p[5];
	int i,j;
	p[3].x=0;
	p[3].y=0;

	while(cin>>p[0].x){
		cin>>p[0].y;

		p[3].x=p[0].x;
		p[3].y=p[0].y;

		for(int i=1;i<3;i++){
			cin>>p[i].x,cin>>p[i].y;

			p[3].x+=p[i].x;
			p[3].y+=p[i].y;
		}
		p[3].x/=3.0;
		p[3].y/=3.0;

		if(isClossLine(p[0].x,p[0].y,p[1].x,p[1].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0 &&
			isClossLine(p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) >0 &&
			isClossLine(p[0].x,p[0].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0){
			cout<<"YES"<<endl;
		}

		else{
			cout<<"NO"<<endl;
		}
	}
	
	
	return 0;
}