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-10)

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

int is_intersect(P a1, P a2, P b1, P b2){
	return (cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS) &&
		(cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS);
}

int main(void){
	double x,y;
	P p[4],o;

	while(1){
		for(int i=0;i<4;i++){
			if(!(cin>>x>>y)) return 0;
			p[i] = P(x,y);
		}

		o = P((p[0].real() + p[1].real() + p[2].real()) / 3,
					(p[0].imag() + p[1].imag() + p[2].imag()) / 3);

		if(is_intersect(p[0],p[1],p[3],o) ||
			 is_intersect(p[1],p[2],p[3],o) ||
			 is_intersect(p[2],p[0],p[3],o)){
			cout<<"NO\n";
		}
		else{
			cout<<"YES\n";
		}
	}
}

C++: #include <stdio.h>
#define line(x1,y1,x2,y2,x3,y3,c) c == '>' ? y3 > (1 / (x1 - x2)) * ((y1 - y2) * x3 + x1 * y2 - x2 * y1):(c == '<' ? y3 < (1 / (x1 - x2)) * ((y1 - y2) * x3 + x1 * y2 - x2 * y1) : 0)

int main(void){
	double x[3], y[3], xp, yp, tmpx, tmpy;
	int i;
	for(i = 0;i < 3;i++)
		scanf("%lf%lf",&x[i],&y[i]);
	scanf("%lf%lf",&xp,&yp);
	if(x[0] < x[1]){
		tmpx = x[0];
		tmpy = y[0];
		x[0] = x[1];
		y[0] = y[1];
		x[1] = tmpx;
		y[1] = tmpy;
	}
	if(line(x[0],y[0],x[1],y[1],x[2],y[2],'>') && line(x[0],y[0],x[1],y[1],xp,yp,'>')){
		if(x[2] > x[0]){
			if(line(x[0],y[0],x[2],y[2],xp,yp,'>') && line(x[1],y[1],x[2],y[2],xp,yp,'<'))
				printf("YES\n");
			else
				printf("NO\n");
		}else if(x[2] == x[0]){
			if(x[2] > xp && y[2] > yp && line(x[1],y[1],x[2],y[2],xp,yp,'<'))
				printf("YES\n");
			else
				printf("NO\n");
		}else if(x[2] > x[1]){
			if(line(x[0],y[0],x[2],y[2],xp,yp,'<') && line(x[1],y[1],x[2],y[2],xp,yp,'<'))
				printf("YES\n");
			else
				printf("NO\n");
		}else if(x[2] == x[1]){
			if(x[2] > xp && y[2] > yp && line(x[0],y[0],x[2],y[2],xp,yp,'<'))
				printf("YES\n");
			else
				printf("NO\n");
		}else if(x[2] < x[1]){
			if(line(x[0],y[0],x[2],y[2],xp,yp,'<') && line(x[1],y[1],x[2],y[2],xp,yp,'>'))
				printf("YES\n");
			else
				printf("NO\n");
		}
	}
	else if(line(x[0],y[0],x[1],y[1],x[2],y[2],'<') && line(x[0],y[0],x[1],y[1],xp,yp,'<')){
		if(x[2] > x[0]){
			if(line(x[0],y[0],x[2],y[2],xp,yp,'<') && line(x[1],y[1],x[2],y[2],xp,yp,'>'))
				printf("YES\n");
			else
				printf("NO\n");
		}else if(x[2] == x[0]){
			if(x[2] > xp && y[2] < yp && line(x[1],y[1],x[2],y[2],xp,yp,'>'))
				printf("YES\n");
			else
				printf("NO\n");
		}else if(x[2] > x[1]){
			if(line(x[0],y[0],x[2],y[2],xp,yp,'>') && line(x[1],y[1],x[2],y[2],xp,yp,'>'))
				printf("YES\n");
			else
				printf("NO\n");
		}else if(x[2] == x[1]){
			if(x[2] > xp && y[2] < yp && line(x[0],y[0],x[2],y[2],xp,yp,'>'))
				printf("YES\n");
			else
				printf("NO\n");
		}else if(x[2] < x[1]){
			if(line(x[0],y[0],x[2],y[2],xp,yp,'>') && line(x[1],y[1],x[2],y[2],xp,yp,'<'))
				printf("YES\n");
			else
				printf("NO\n");
		}
	}
	else
		printf("NO\n");
	return 0;
}

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

double outer_product_z(double X[], double Y[]){
	return X[0]*Y[1]-X[1]*Y[0];
}

int main(void){
	while(1){
		double x[4], y[4];
		for(int i=0;i<4;i++){
			cin >> x[i] >> y[i];
		}
		double vec_ap[2] = {(x[3]-x[0]),(y[3]-y[0])};
		double vec_bp[2] = {(x[3]-x[1]),(y[3]-y[1])};
		double vec_cp[2] = {(x[3]-x[2]),(y[3]-y[2])};
		double vec_ab[2] = {(x[1]-x[0]),(y[1]-y[0])};
		double vec_bc[2] = {(x[2]-x[1]),(y[2]-y[1])};
		double vec_ca[2] = {(x[0]-x[2]),(y[0]-y[2])};

		if((outer_product_z(vec_ap,vec_ab)>0&&outer_product_z(vec_bp,vec_bc)>0&&outer_product_z(vec_cp,vec_ca)>0) || (outer_product_z(vec_ap,vec_ab)<0&&outer_product_z(vec_bp,vec_bc)<0&&outer_product_z(vec_cp,vec_ca)<0)){
			cout << "Yes" << endl;
		}
		else{
			cout << "No" << endl;
		}
		if(cin.eof()) return 0;	
	}

}

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

int main(){
  C v[4];
  double x[4], y[4];
  while(cin >> x[0] >> y[0]){
    v[0] = C(x[0], y[0]);
    for(int i=1;i<4;i++){
      cin >> x[i] >> y[i];
      v[i] = C(x[i], y[i]);
    }
    C PA = v[0] - v[3], PB = v[1] - v[3], PC = v[2] - v[3];
    double pab = (conj(PA) * PB).imag(), pbc = (conj(PB) * PC).imag(), pca = (conj(PC) * PA).imag();
    if(pab * pbc > 0 && pbc * pca > 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <iostream>
#include <map>
#include <functional>
#include <cstdlib>
#include <numeric>
#include <queue>
#include <complex>
#include <sstream>
#include <stack>

using namespace std;

#define reep(i, f, n) for (int i = f; i < n; ++i)
#define rep(i, n) reep(i, 0, n)


int main(){
    float x1,x2,x3,y1,y2,y3,xp,yp;
    while(scanf("%f %f %f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp) != EOF){
        double d1 = (x2-x1)*(yp-y1) - (xp-x1)*(y2-y1);
        double d2 = (x3-x2)*(yp-y2) - (xp-x2)*(y3-y2);
        double d3 = (x1-x3)*(yp-y3) - (xp-x3)*(y1-y3);
        if (( d1<0 && d2<0 && d3<0 ) || ( d1>0 && d2>0 && d3>0 )) printf("YES");
        else printf("NO");
    }
}

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

int main(){
  double x[3],y[3],xp,yp,xmax,ymax,xmin,ymin;

  xmax = 0; ymax = 0; xmin = 999999; ymin = 999999;
  while( cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp ){
    for(int i = 0 ; i < 3 ; i++ ){
      if( xmax < x[i] ) xmax = x[i];
      if( xmin > x[i] ) xmin = x[i];
      if( ymax < y[i] ) ymax = y[i];
      if( ymin > y[i] ) ymin = y[i];
    }
    if( ( xmin <= xp && xp <= xmax ) && (ymin <= yp && yp <= ymax ))
      cout <<"YES" << endl;
    else cout <<"NO" << endl;
  }

  return 0;
}

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

int main()
{
	double x[3],y[3],xp,yp;

	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
		
		xp+=100;
		yp+=100;
		for(int i=0;i<3;++i){
			x[i]+=100;
			y[i]+=100;
		}

		if(abs(x[0]-x[1]) >xp || abs(x[1]-x[2]) > xp || abs(x[0]-x[2]) > xp &&
		   abs(y[0]-y[1]) >yp || abs(y[1]-y[2]) > yp || abs(y[0]-y[2]) > yp)
			   cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

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

typedef complex<double> Pt;
double cross(const Pt &a, const Pt &b) { return imag(conj(a)*b); }

int main()
{
    double x1, x2, x3, y1, y2, y3, xp, yp;
    while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
    {
        Pt a = Pt(x1, y1), b = Pt(x2, y2), c = Pt(x3, y3), p = Pt(xp, yp);
        a -= p; b -= p; c -= p;
        double d = cross(a, b) * cross(b, c);
        double e = cross(b, c) * cross(c, a);
        cout << (d > 0 && e > 0 ? "YES" : "NO") << endl;
    }
}