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 <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 { a, b, c, 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<cmath>
#include<iostream>
using namespace std;
#define PI 3.141592

double wn_angle(int x, int y)
{
  double r = acos(x / sqrt(x * x + y * y));
  // y????????????????¬¬3, 4?±????
  if(y < 0)
    r = PI * 2 - r;
  return y < 0 ? PI * 2 - r : r;
}

int winding_number(int x, int y, double p[][2], int n)
{
  int xx = p[n - 1][0] - x, yy = y - p[n - 1][1] - y;
  double r1 = wn_angle(xx, yy);
  double s = 0;
  for(int i = 0; i < n; i++)
  {
    int xx = p[i][0] - x, yy = p[i][1] - y;
    double r2 = wn_angle(xx, yy);
    double ts = r2 - r1;
    // 180???????????§?????????????????¨?????????
    if(abs(ts) > PI)
      ts = ts / abs(ts) * (PI - abs(ts));
    s += ts ;
    r1 = r2;
  }
  return abs(s) < PI ? 0 : 1;
}


double p[3][2];
int main()
{
  while(cin >> p[0][0] >> p[0][1] >> p[1][0] >> p[1][1] >> p[2][0] >> p[2][1])
  {
    double x, y;
    cin >> x >> y;
    cout << (winding_number(x, y, p, 3) ? "YES" : "NO") << endl;;
  }
}

C++: #include <iostream>
using namespace std;
#define f(a,b) ((x[i]-x[(i+1)%3])*(b-y[i])-(y[i]-y[(i+1)%3])*(a-x[i]))
int main()
{
	double x[4],y[4];
	while(cin>>x[0]>>y[0]){
		for(int i=1;i<4;i++) cin>>x[i]>>y[i];
		bool f=false;
		for(int i=0;i<3;i++){
			if(f(x[(i+2)%3],y[(i+2)%3])*f(x[3],y[3]) < 0){
				f = true;
				break;
			}
		}
		if(f) cout<<"NO\n";
		else cout<<"YES\n";
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <limits.h>
using namespace std;
struct Point
{
	Point() :x(0.0), y(0.0) {}
	Point(double _x, double _y) : x(_x), y(_y) {}
	double x;
	double y;
};
bool HalfPlaneTest(const Point& P1, const Point& P2, const Point& P)
{
	return ((P2.y - P1.y) * P.x - (P2.x - P1.x) * P.y + (P2.x * P1.y - P1.x * P2.y)) > 0;
}
struct Triangle
{
	Triangle() : minX(DBL_MAX), maxX(DBL_MIN), minY(DBL_MAX), maxY(DBL_MIN) {}
	void add(double x, double y) {
		vP.push_back(Point(x, y));
		if (x < minX) minX = x;
		if (x > maxX) maxX = x;
		if (y < minY) minY = y;
		if (y > maxY) maxY = y;
		if (vP.size() == 3){
			if (HalfPlaneTest(vP[0], vP[1], vP[2]))
				swap(vP[1], vP[2]);
		}
	}
	bool IsInclude(double x, double y){
		if (x <= minX || x >= maxX || y <= minY || y >= maxY)
			return false;
		Point p(x, y);
		if (HalfPlaneTest(vP[0], vP[1], p)) return false;
		if (HalfPlaneTest(vP[1], vP[2], p)) return false;
		if (HalfPlaneTest(vP[2], vP[0], p)) return false;
		return true;
	}
	vector<Point> vP;
	double minX;
	double maxX;
	double minY;
	double maxY;
};

int main()
{
	double x1, y1, x2, y2, x3, y3, x, y;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y){
		Triangle triangle;
		triangle.add(x1, y1);
		triangle.add(x2, y2);
		triangle.add(x3, y3);
		if (triangle.IsInclude(x, y))	cout << "YES\n";
		else							cout << "NO\n";
	}
	return 0;
}

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

class Pos {
public:
	const static int ABOVE = 1;
	const static int BELOW = 0;
	float x, y;
	int getWhichSide(Pos a, Pos b) {
		if (a.x == b.x) {
			return (x > a.x) ? ABOVE : BELOW;
		}
		float slope = (a.y - b.y) / (a.x - b.x);
		float bias =  b.y - slope * b.x;
		return (y > slope * x + bias) ? ABOVE : BELOW;
	}
};

int main () {
	Pos t1, t2, t3, p;
	while (~scanf("%f %f %f %f %f %f %f %f", &t1.x, &t1.y, &t2.x, &t2.y, &t3.x, &t3.y, &p.x, &p.y)) {
		if (
			p.getWhichSide(t1, t2) == t3.getWhichSide(t1, t2)
			&& p.getWhichSide(t2, t3) == t1.getWhichSide(t2, t3)
			&& p.getWhichSide(t1, t3) == t2.getWhichSide(t1, t3)
		) {
			printf("YES\n");
		} else {
			printf("NO\n");
		}
	}

	return 0;
}