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 double(a.real()*b.imag()-a.imag()*b.real());
}

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 <iostream>
#include <complex>
#include <cmath>
using namespace std;

#define X real()
#define Y imag()
#define PI M_PI
#define EPS (1e-10)
typedef complex<double> point;

double angle(point a,point b,point c){ //?§????????¨????????????¢??°
	double A=abs(b-c);
	double B=abs(c-a);
	double C=abs(a-b);
	return acos((B*B+C*C-A*A)/(2.0*B*C)); //??????????????????
}

bool judge(point p,point a,point b,point c){
	double A=angle(p,a,b);
	double B=angle(p,b,c);
	double C=angle(p,c,a);
	return (abs(A+B+C-2*PI)<EPS)? true : false;
}

int main(void){
	point a,b,c,p;
	double x1,y1,x2,y2,x3,y3,xp,yp;

	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
		a.X=x1; a.Y=y1;
		b.X=x2; b.Y=y2;
		c.X=x3; c.Y=y3;
		p.X=xp; p.Y=yp;
		if(judge(p,a,b,c)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

template <typename T>
struct Vec2;

template <typename T>
T SqrMagnitude(const Vec2<T>& v);

template <typename T>
T Magnitude(const Vec2<T>& v);

template <typename T>
T Dot(const Vec2<T>& v1, const Vec2<T>& v2);


template <typename T>
struct Vec2 {
    T x, y;
    Vec2() = default;
    Vec2(T in_x, T in_y)
        : x {in_x}, y {in_y} {};
    Vec2(const Vec2&) = default;
    Vec2(Vec2&&) = default;

    Vec2 normalized() const{
        T mag = Magnitude(*this);
        return {x / mag, y / mag};
    }

    Vec2 normalize() {
        T mag = Magnitude(*this);
        return {x /= mag, y /= mag};
    }

    Vec2 operator-() {
        return {-x, -y};
    }

    Vec2 operator+(const Vec2& rhs) const{
        return {x + rhs.x, y + rhs.y};
    }

    Vec2 operator-(const Vec2& rhs) const{
        return {x - rhs.x, y - rhs.y};
    }

    Vec2 operator*(T rhs) const{
        return {x * rhs, y * rhs};
    }

    Vec2 operator/(T rhs) const{
        return {x / rhs, y / rhs};
    }

    Vec2& operator+=(const Vec2& rhs) {
        x += rhs.x;
        y += rhs.y;
        return *this;
    }

    Vec2& operator-=(const Vec2& rhs) {
        x -= rhs.x;
        y -= rhs.y;
        return *this;
    }

    Vec2& operator*=(T rhs) {
        x *= rhs;
        y *= rhs;
        return *this;
    }

    Vec2& operator/=(T rhs) {
        x /= rhs;
        y /= rhs;
        return *this;
    }
};

template <typename T>
inline Vec2<T> operator*(T s, const Vec2<T>& v) {
    return {s * v.x, s * v.y};
}


template <typename T>
inline T SqrMagnitude(const Vec2<T>& v) {
    return Dot(v, v);
}

template <typename T>
inline T Magnitude(const Vec2<T>& v) {
    return sqrt(SqrMagnitude(v));
}

template <typename T>
inline T Dot(const Vec2<T>& v1, const Vec2<T>& v2) {
    return v1.x * v2.x + v1.y * v2.y;
}

template <typename T>
inline T Cross(const Vec2<T>& v1, const Vec2<T>& v2) {
    return v1.x * v2.y - v1.y *v2.x;
}

int main() {
    Vec2<double> p0, p1, p2, q;


    while(cin >> p0.x >> p0.y >> p1.x >> p1.y >> p2.x >> p2.y >> q.x >> q.y) {
        auto v_qp0 = p0 - q;
        auto v_qp1 = p1 - q;
        auto v_qp2 = p2 - q;

        double c0 = Cross(v_qp0, v_qp1);
        double c1 = Cross(v_qp1, v_qp2);
        double c2 = Cross(v_qp2, v_qp0);

        cout << ((c0 > 0 && c1 > 0 && c2 > 0) || (c0 < 0 && c1 < 0 && c2 < 0) ? "YES" : "NO") << endl;
    }
        
        
    

    return 0;
}

C++: #include <stdio.h>

bool is_up(const float x1, const float y1,
			const float x2, const float y2,
			const float xp, const float yp){
	float y = 0.0;
	y = (y2 - y1)/(x2 - x1)*(xp - x1) + y1;
	return yp > y;
}

bool is_ok(float *x, float *y, float xp, float yp){
	for(int i=0; i<3; ++i){
		if(is_up(x[i], y[i], x[(i+1)%3], y[(i+1)%3], x[(i+2)%3], y[(i+2)%3])
			!= is_up(x[i], y[i], x[(i+1)%3], y[(i+1)%3], xp, yp)){
				return false;
		}
	}
	return true;
}

int main(void){
	float x[3], y[3];
	float xp=0.0, yp=0.0;
	bool ok = false;

	for(int i=0; i<3; ++i){
		x[i] = y[i] = 0.0;
	}

	while(scanf("%f %f %f %f %f %f %f %f",
		x, y, x+1, y+1, x+2, y+2, &xp, &yp) != EOF){
			puts(is_ok(x, y, xp, yp) ? "YES": "NO");
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <complex>
#define rep(i,n) for(int i=0; i<(n); i++)
#define EPS 1e-5
using namespace std;

typedef complex<double> cd;

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

int main(){
  cd a[4];
  double x1, y1, x2, y2, x3, y3, xp, yp;

  while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)!=EOF){
    a[0] = cd(x1,y1);
    a[1] = cd(x2,y2);
    a[2] = cd(x3,y3);
    a[3] = cd(xp,yp);
    if(abs(s(a[0]-a[3], a[1]-a[3])
           + s(a[1]-a[3], a[2]-a[3])
           + s(a[2]-a[3], a[0]-a[3])
           - s(a[1]-a[0], a[2]-a[0])) < EPS )
      printf("IN\n");
    else
      printf("OUT\n");
  }
  
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

const double ERR = 1e-6;

typedef pair<double, double> XY;

double getlen(XY p, XY q) {
    return sqrt((p.first-q.first)*(p.first-q.first) + (p.second-q.second)*(p.second-q.second));
}

double area(XY p, XY q, XY r) {
    double pq, pr, qr;
    pq = getlen(p,q); pr = getlen(p,r); qr = getlen(q,r);
    return 0.5 * pq * pr * sin(acos((pq*pq + pr*pr - qr*qr)/2/pq/pr));
}

int main() {
    double x1,y1,x2,y2,x3,y3,xx,yy;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xx>>yy) {
        XY xy1, xy2, xy3, xyp;
        xy1 = make_pair(x1,y1);
        xy2 = make_pair(x2,y2);
        xy3 = make_pair(x3,y3);
        xyp = make_pair(xx,yy);
        if (abs(area(xy1,xy2,xy3) - (area(xy1,xy2,xyp) + area(xy2,xy3,xyp) + area(xy3,xy1,xyp))) < ERR) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}