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 <complex>

using namespace std;

typedef complex<double> P;

#define  EPS (1e-11)
#define  EQ(a, b)  (abs((a) - (b)) < EPS)
#define  EQV(a, b)  (EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()))

double cross(P a, P b) 
{
    return (a.real() * b.imag() - a.imag() * b.real());
}

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

    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        P a = P(x1, y1);
        P b = P(x2, y2);
        P c = P(x3, y3);
        P x = P(xp, yp);

        if ((cross(b - a, x - a) > EPS &&
             cross(c - b, x - b) > EPS &&
             cross(a - c, x - c) > EPS) ||
            (cross(b - a, x - a) < -EPS &&
             cross(c - b, x - b) < -EPS &&
             cross(a - c, x - c) < -EPS))
            cout << "YES\n";
        else
            cout << "NO\n";
    }

    return 0;
}

C++: #include <iostream>
using namespace std;
double x[4],y[4],px,py,ax,ay,bx,by;
int main()
{
	while(true)
	{
		for(int i = 1;i<=3;i++){cin >> x[i];cin >> y[i];}
		if(cin.eof())break;
		cin >> px;
		cin >> py;
		double m,n,s;
		ax = x[2]-x[1];
		ay = y[2]-y[1];
		bx = x[3]-x[1];
		by = y[3]-y[1];
		double det = ax*by-ay*bx;
		m = (by*px-bx*py)/det;
		n = (-ay*px+ax*py)/det;
		if(m>0 && n > 0&& (m+n) < 1) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve
double x[4], y[4];

double calc(int i, int j, int k){
  return 0.5 * abs((x[j] - x[i]) * (y[k] - x[i]) - (x[k] - x[i]) * (y[j] - y[i]));
}

int main(int argc, char const* argv[])
{
  while(cin >> x[0]){
    cin >> y[0];
    FOR(i, 1, 4){
      cin >> x[i] >> y[i];
    }
    double area = calc(0, 1, 2);
    double tmp = calc(0, 1, 3) + calc(0, 2, 3) + calc(1, 2, 3);
    if(abs(area - tmp) < EPS){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
	return 0;
}

C++: #include <iostream>

using namespace std;

template <typename T>
struct Vector2
{
// variable
public:
	T x;
	T y;

// structor
public:
	Vector2(const Vector2& other) :
		x(other.x),
		y(other.y)
	{

	}

	Vector2(T x = 0, T y = 0) :
		x(x),
		y(y)
	{

	}

// operator
public:
	Vector2 operator-(const Vector2<T>& rhs) const
	{
		return Vector2(x - rhs.x, y - rhs.y);
	}

	Vector2& operator=(const Vector2<T>& rhs)
	{
		x = rhs.x;
		y = rhs.y;
		return *this;
	}
};

template <typename T>
ostream& operator<< (ostream& stream, const Vector2<T>& rhs)
{
	stream << '(' << rhs.x << ", " << rhs.y << ')';
	return stream;
}

template <typename T>
istream& operator>> (istream& stream, Vector2<T>& rhs)
{
	stream >> rhs.x >> rhs.y;
	return stream;
}

template <typename T>
int relation(const Vector2<T>& p1, const Vector2<T>& p2)
{
	T product = p1.x * p2.y - p1.y * p2.x;
		
	return
		product == 0 ? 0 : (product > 0 ? 1 : -1);
}

int main()
{
	Vector2<double> a, b, c, p;
	while(cin >> a >> b >> c >> p)
	{
		if( relation(b-a, b-p) > 0 || relation(c-b, b-p) > 0 || relation(a-c, a-p) > 0 )
			cout << "NO" << endl;
		else
			cout << "YES" << endl;
	}
	return 0;
}

C++: #include <complex>
#include <cmath>
#include <iostream>
using namespace std;
typedef complex<double> xy_t;

double dot_product(xy_t a,xy_t b) {
  return (conj(a)*b).real();
}

double cross_product(xy_t a, xy_t b) {
  return (conj(a)*b).imag();
}

xy_t projection(xy_t p,xy_t b) {
  return b * dot_product(p,b)/norm(b);
}

xy_t A[4];
double re,im;
double S[3];

int main() {
  while(true) {
    for (int i=0;i<4;i++) {
      if (scanf("%lf%lf",&re,&im) == EOF) {
	goto STOP;
      }
      xy_t P(re,im);
      A[i] = P;
    }
    for (int i=0;i<3;i++) {
      S[i] = cross_product(A[i%3]-A[3],A[(i+1)%3]-A[3]);
    }
    if ((S[0] > 0 && S[1] > 0 && S[2] > 0) || (S[0] < 0 && S[1] < 0 && S[2] < 0)) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
 STOP: return 0;
}

C++: #include <iostream>

double cross(double ax, double ay, double bx, double by)
{
    return ax*by - ay*bx;
}

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

    /* A(x1, y1)
     * B(x2, y2)
     * C(x3, y3)
     * P(xp, yp)
     * */
    double x1,y1,x2,y2,x3,y3,xp,yp;
    while (std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        if (cross(x2-x1, y2-y1, xp-x1, yp-y1) > 0 &&
            cross(x3-x2, y3-y2, xp-x2, yp-y2) > 0 &&
            cross(x1-x3, y1-y3, xp-x3, yp-y3) > 0)
            std::cout << "YES" << std::endl;
        else
            std::cout << "NO" << std::endl;
    }
}

C++: #include <iostream>

struct Vec2D{
				double x,y;
};

Vec2D vector(double x1,double y1,double x2,double y2){
				Vec2D vec;
				vec.x = x2 -x1;
				vec.y = y2 -y1;
				return vec;
}

double outerProduct(Vec2D a,Vec2D b){
				double crossProduct = a.x * b.y - a.y * b.x;
				return crossProduct;
}

int main(int argc, char *argv[])
{
	double x1,x2,x3,y1,y2,y3,x,y;

	while(std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y){

		Vec2D BA = vector(x2,y2,x1,y1);
		Vec2D CB = vector(x3,y3,x2,y2);
		Vec2D AC = vector(x1,y1,x3,y3);


		Vec2D BP = vector(x2,y2,x,y);
		Vec2D CP = vector(x3,y3,x,y);
		Vec2D AP = vector(x1,y1,x,y);

		double a,b,c;

		a = outerProduct(BA,BP);
		b = outerProduct(CB,CP);
		c = outerProduct(AC,AP);



		if(a<0 && b<0 && c<0){
					std::cout << "YES" << std::endl;
		}else{
					std::cout << "NO" << std::endl;
		}

	}
}