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 <cstdio>
#include <iostream>
#include <complex>
#define rep(i,n) for(int i=0; i<(n); i++)
#define EPS 1e-10
using namespace std;

typedef complex<double> cd;

double s(cd a, cd b){
  return abs(double(a.real()*b.imag()-a.imag()*b.imag()));
}

int main(){
  cd a[4];

  for(;;){
    rep(i,4){
      double x,y;
      if(!~scanf(" %lf %lf", &x,&y))
        return 0;
      a[i]=cd(x,y);
    }
    
    if((s(a[0]-a[3], a[1]-a[3]) > 0 && 
        s(a[1]-a[3], a[2]-a[3]) > 0 &&
        s(a[2]-a[3], a[1]-a[3]) > 0 ) ||
       (s(a[0]-a[3], a[1]-a[3]) < 0 && 
        s(a[1]-a[3], a[2]-a[3]) < 0 &&
        s(a[2]-a[3], a[1]-a[3]) < 0 ))
      printf("IN\n");
    else
      printf("OUT\n");
  }
  
  return 0;
}

C++: #include <complex>
#include <cmath>
#include <vector>
#include <cstdio>
#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); }

int main(){
  double x[4], y[4];
  double pab, pbc, pca;
  while(true){
    for(int i=0; i<4; ++i){
      cin >> x[i] >> y[i];
    }
    if(!cin) break;
    xy_t a(x[0],y[0]), b(x[1],y[1]), c(x[2],y[2]), p(x[3],y[3]);
    pab = cross_product(a-p,b-p) / 2;
    pbc = cross_product(b-p,c-p) / 2;
    pca = cross_product(c-p,a-p) / 2;
    bool ok = ((pab>0) && (pbc>0) && (pca>0)) || ((pab<0) && (pbc<0) && (pca<0));
    cout << (ok ? "YES" : "NO") << endl;
  }
}

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

class Vec{
public:
	double x, y;
	Vec(const double x, const double y) :x(x), y(y){}
	Vec() :x(0), y(0){}
	double cross(const Vec& tgt){
		return (x*tgt.y) - (y*tgt.x);
	}
};

Vec operator - (const Vec& v2, const Vec& v1){
	Vec v(v2.x - v1.x, v2.y - v1.y);
	return v;
}

istream& operator >> (istream& strm, Vec& v){
	strm >> v.x >> v.y;
	return strm;
}

bool direc_v(const Vec& v1, const Vec& v2, const Vec& vp){
	if ((v2 - v1).cross(vp - v2) >= 0) return true;
	return false;
}

int main(){
	Vec a, b, c, p;
	
	auto direc = bind(direc_v, placeholders::_1, placeholders::_2, ref(p));

	while (cin >> a >> b >> c >> p){
		if (direc(a, b) != direc(b, c)){
			cout << "NO" << endl;
			continue;
		}
		if (direc(a, b) != direc(c, a)){
			cout << "NO" << endl;
			continue;
		}
		cout << "YES" << endl;
	}

	return 0;
}

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

double d(double x1,double y1,double x2,double y2)
{
	return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
}

double s(double x1,double y1,double x2,double y2,double x3,double y3)
{
	double a = d(x1,y1,x2,y2),b = d(x1,y1,x3,y3),c = d(x2,y2,x3,y3);
	double p = (a + b + c)/2;
	return sqrt(p*(p-a)*(p-b)*(p-c));
}

int main()
{
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
	{
	 double s1 = s(x1,y1,x2,y2,xp,yp),s2 = s(x1,y1,x3,y3,xp,yp),s3 = s(x2,y2,x3,y3,xp,yp),sum = s(x1,y1,x2,y2,x3,y3); 
	 if(abs(sum-(s1+s2+s3))<0.00000000000000000001) cout << "YES" << endl;
	 else cout << "NO" << endl; 
    }
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <math.h>
#include <utility>
#include <cstdlib>
using namespace std;

int main(){
	double x[3],y[3],xp,yp;
	cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp;
	bool ans=true;
	for(int i=0;i<3;i++){
		double gaiseki;
		int k = (i+1)%3;
		double vx,vy,vpx,vpy;
		vx = x[k]-x[i];
		vy = y[k]-y[i];
		vpx = xp-x[i];
		vpy = yp-y[i];
		gaiseki = vx*vpy-vy*vpx;
		if(gaiseki<=0) ans = false;
	}
	if(ans){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>

#define SIZE 3

using namespace std;

float innerProduct(float xp, float yp, float x1, float y1, float x2, float y2) {
	return (xp - x1) * (x2 - x1) + (yp - y1) * (y2 - y1);
}

int main() {
	float x[SIZE], y[SIZE], xp, yp, a, b, c;

	while (cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>xp>>yp) {
		a = innerProduct(xp, yp, x[0], y[0], x[1], y[1]);
		b = innerProduct(xp, yp, x[1], y[1], x[2], y[2]);
		c = innerProduct(xp, yp, x[2], y[2], x[0], y[0]);

		if ((a > 0 && b > 0 && c > 0) || (a < 0 && b < 0 && c < 0)) {
			cout << "YES";
		}
		else {
			cout << "NO";
		}
		cout << endl;
	}
	return 0;
}