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++: /*
 * Problem     : AOJ0010
 * Title       : A Point in a Triangle
 * Author      : mizo0203
 * Copyright   : Your copyright free
 * Description : 三角形による包含判定
 *               http://www5d.biglobe.ne.jp/~tomoya03/shtml/algorithm/Hougan.htm
 */

#include <stdio.h>
#include <math.h>
using namespace std;

typedef struct point {
  double x;
  double y;
} POINT;

POINT t[3], p;

bool input() {
  int i;

  for (i = 0; i < 3; i++) {
    if (scanf("%lf %lf", &t[i].x, &t[i].y) == EOF) return false;
  }
  scanf("%lf %lf", &p.x, &p.y);

  return true;
}

double intersectM(POINT p1, POINT p2, POINT p3, POINT p4) {
  return ((p1.x - p2.x) * (p3.y - p1.y) + (p1.y - p2.y) * (p1.x - p3.x))
      * ((p1.x - p2.x) * (p4.y - p1.y) + (p1.y - p2.y) * (p1.x - p4.x));
}

bool PosIncludeTriEx(POINT tp1, POINT tp2, POINT tp3, POINT xp) {

  if ((tp1.x - tp3.x) * (tp1.y - tp2.y) == (tp1.x - tp2.x) * (tp1.y - tp3.y))
    return false;

  if (intersectM(tp1, tp2, xp, tp3) < 0)
    return false;
  if (intersectM(tp1, tp3, xp, tp2) < 0)
    return false;
  if (intersectM(tp2, tp3, xp, tp1) < 0)
    return false;

  return true;
}

int main() {
  while (input()) {
    if (PosIncludeTriEx(t[0], t[1], t[2], p))
      printf("YES\n");
    else
      printf("NO\n");
  }

  return 0;
}

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

double gaiseki(double x1,double y1,double x2,double y2){

	double ab;
	ab = x1*y2 - y1*x2;
	if (ab>=0)
		ab=1;
	else
		ab=-1;
	return ab;
}

int main() {

	//A(x1,y1,0)
	//B(x2,y2,0)
	//C(x3,y3,0)
	
	double x1,y1,x2,y2,x3,y3,xp,yp;
	
	while(cin >>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		if (  ( gaiseki(x1-x2,y1-y2,xp-x2,yp-y2)+gaiseki(x2-x3,y2-y3,xp-x3,yp-y3)+gaiseki(x3-x1,y3-y1,xp-x1,yp-y1) == 3 )||( gaiseki(x1-x2,y1-y2,xp-x2,yp-y2)+gaiseki(x2-x3,y2-y3,xp-x3,yp-y3)+gaiseki(x3-x1,y3-y1,xp-x1,yp-y1) == -3 )  )
			cout << "YES" <<endl;
		else
			cout << "NO" <<endl;
	}

	return 0;
  
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){

    double x[4],y[4];
    while(true){
	REP(i,4) {
	    cin >> x[i] >> y[i];
	    if(cin.eof()) break;
	    //cin >> y[i];
	}
	double s,t;
	bool flg = false;
	REP(i,1e6){
	    s = ((double)i/1e6);
	    t = (double)1 - s;
	    double x1 = s * (x[2] - x[0]) + t * ( x[1] - x[0]);
	    double y1 = s * (y[2] - y[0]) + t * ( y[1] - y[0]);
	    double x2 = x[3] - x[0];
	    double y2 = y[3] - y[0];
	    double dotpro = (  (  (x1 * x2 + y1 * y2 )*(x1 * x2 + y1 * y2 ) )  /( (x1*x1 + y1*y1)*(x2*x2 + y2*y2))); 
	    //cout << dotpro << endl;
	    if(  1 - dotpro  <= 1e-3  ){
		    flg = true;
		    break;
	    }
	}
	if(flg) cout << "YES" << endl;
	else cout << "NO" << endl;

    }

    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;
		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 && m < 1 && n > 0 && n < 1 && m+n < 1 ) {cout << "YES" ;}
		else {cout << "NO" ;}
		cout << endl;
	}
	return 0;
}

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

#define double long double

double T(double a[3]) {
	double res, sum;
	res = a[0] + a[1] + a[2];
	sum = res;
	for(int i = 0; i < 3; i++) {
		res *= sum - 2.0 * a[i];
	}
	return sqrt(res);
}

double dist(double ax, double ay, double bx, double by) {
	return sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by));
}

int main() {
	while(1) {
		bool exit = false;
		double x[4], y[4];
		double d0[3], d1[3];
		for(int i = 0; i < 4; i++) {
			if(!(cin >> x[i] >> y[i]))
				exit = true;
		}
		if(exit)
			break;
		for(int i = 0; i < 3; i++) {
			d0[i] = dist(x[i], y[i], x[(i+1)%3], y[(i+1)%3]);
			d1[i] = dist(x[i], y[i], x[3], y[3]);
		}
		bool flg = true;
		double S0, S1;
		S0 = T(d0); S1 = 0;
		for(int i = 0; i < 3; i++) {
			double res;
			double tmp[3] = {d0[i], d1[i], d1[(i+1)%3]};
			/*
			   for(int i = 0; i < 3; i++)
			   cout << tmp[i] << " ";
			   cout << endl;
			   */
			res = T(tmp);
			if(res < 1e-16)
				flg = false;
			S1 += res;
		}
		//cout << S1 - S0 << endl;
		if(flg && fabs(S1 - S0) < 1e-16)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

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

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

double cross(double x1,double y1,double x2,double y2)
{
	return x1*y2-x2*y1;
}

int ccw(double x1,double y1,double x2,double y2,double x3,double y3)
{
	return cross(x2-x1,y2-y1,x3-x1,y3-y1)>0;
}

int main()
{
	//float x,y,a,b,n,m,p,q;
	//int i;
	//for(;~scanf("%f%f%f%f%f%f%f%f",&x,&y,&a,&b,&n,&m,&p,&q);puts(i>2^!i?"YES":"NO"))
	//	i=((p-x)*(b-y)>(q-y)*(a-x))+((p-a)*(m-b)>(q-b)*(n-a))+((p-n)*(y-m)>(q-m)*(x-n));
	
	for(double x,y,a,b,n,m,p,q;scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x,&y,&a,&b,&n,&m,&p,&q)==8;){
		int counter=0;
		//counter+=(p-x)*(b-y)-(q-y)*(a-x)>0;
		//counter+=(p-a)*(m-b)-(q-b)*(n-a)>0;
		//counter+=(p-n)*(y-m)-(q-m)*(x-n)>0;
		counter+=cross(a-x,b-y,p-x,q-y)>0;
		counter+=cross(n-a,m-b,p-a,q-b)>0;
		counter+=cross(x-n,y-m,p-n,q-m)>0;
		
		cout<<(counter%3==0?"YES":"NO")<<endl;
	}
	
	return 0;
}