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<math.h>
using namespace std;
double area_3point(double x1,double y1,double x2,double y2,double x3,double y3);
int main(){
        while(1){               
                double x1,y1,x2,y2,x3,y3,xp,yp;
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp;
                if(cin.eof()) break;
		double s,s1,s2,s3;  
                s=area_3point(x1,y1,x2,y2,x3,y3);
 		s1= area_3point(x1,y1,x2,y2,xp,yp);
		s2=area_3point(x1,y1,xp,yp,x3,y3);               
  		s3=area_3point(xp,yp,x2,y2,x3,y3);  
                if(s<(s1+s2+s3-0.0000001)){ 
                       cout<<"NO"<<endl;
                }else {     
                        cout<<"YES"<<endl; }        
        }
        return 0;
}

double area_3point(double x1,double y1,double x2,double y2,double x3,double y3){
     double s,a,b,c,area;
     a = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
     b = sqrt((x2-x3)*(x2-x3) + (y2-y3)*(y2-y3));
     c = sqrt((x3-x1)*(x3-x1) + (y3-y1)*(y3-y1));
     s=(a+b+c)/2.0;
     area=sqrt(s*(s-a)*(s-b)*(s-c));

     return area;
}

C++: #include <iostream>
#include <vector>
#include <limits>
using namespace std;
struct Point
{
	Point() :x(0.0), y(0.0) {}
	Point(double _x, double _y) : x(_x), y(_y) {}
	double x;
	double y;
};
bool HalfPlaneTest(const Point& P1, const Point& P2, const Point& P)
{
	return ((P2.y - P1.y) * P.x - (P2.x - P1.x) * P.y + (P2.x * P1.y - P1.x * P2.y)) > 0;
}
struct Triangle
{
	Triangle() : minX(DBL_MAX), maxX(DBL_MIN), minY(DBL_MAX), maxY(DBL_MIN) {}
	void add(double x, double y) {
		vP.push_back(Point(x, y));
		if (x < minX) minX = x;
		if (x > maxX) maxX = x;
		if (y < minY) minY = y;
		if (y > maxY) maxY = y;
		if (vP.size() == 3){
			if (HalfPlaneTest(vP[0], vP[1], vP[2]))
				swap(vP[1], vP[2]);
		}
	}
	bool IsInclude(double x, double y){
		if (x <= minX || x >= maxX || y <= minY || y >= maxY)
			return false;
		Point p(x, y);
		if (HalfPlaneTest(vP[0], vP[1], p)) return false;
		if (HalfPlaneTest(vP[1], vP[2], p)) return false;
		if (HalfPlaneTest(vP[2], vP[0], p)) return false;
		return true;
	}
	vector<Point> vP;
	double minX;
	double maxX;
	double minY;
	double maxY;
};

int main()
{
	double x1, y1, x2, y2, x3, y3, x, y;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y){
		Triangle triangle;
		triangle.add(x1, y1);
		triangle.add(x2, y2);
		triangle.add(x3, y3);
		if (triangle.IsInclude(x, y))	cout << "YES\n";
		else							cout << "NO\n";
	}
	return 0;
}

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

using namespace std;

double square(double, double, double, double, double, double);

int main() {

	double x1, y1, x2, y2, x3, y3, xp, yp, S123, SP12, SP23, SP31;

	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		S123=square(x1, y1, x2, y2, x3, y3);
		SP12=square(xp, yp, x1, y1, x2, y2);
		SP23=square(xp, yp, x2, y2, x3, y3);
		SP31=square(xp, yp, x3, y3, x1, y1);

		if(S123==SP12+SP23+SP31)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;

}

double square(double x1, double y1, double x2, double y2, double x3, double y3) {

	double a, b, c, d;

	a=x2-x1;
	b=y2-y1;
	c=x3-x1;
	d=y3-y1;

	return abs(a*d-c*b)/2;

}

C++: #include <stdio.h>
#include <math.h>

int main()
{
	double x1,y1,x2,y2,x3,y3,xp,yp;
	char a[40],b[40],c[40],d[40];
	while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)==8)
	{
		sprintf(a,"%.3lf",fabs(x1*(y2-y3)-x2*(y1-y3)+x3*(y1-y2)));
		sprintf(b,"%.3lf",fabs(x1*(y2-yp)-x2*(y1-yp)+xp*(y1-y2)));
		sprintf(c,"%.3lf",fabs(x1*(yp-y3)-xp*(y1-y3)+x3*(y1-yp)));
		sprintf(d,"%.3lf",fabs(xp*(y2-y3)-x2*(yp-y3)+x3*(yp-y2)));
		sscanf(a,"%lf",&xp);
		sscanf(b,"%lf",&x1);
		sscanf(c,"%lf",&x2);
		sscanf(d,"%lf",&x3);
		if (xp==x1+x2+x3)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<iostream>
#include<complex>
#include<vector>
#include<cmath>
#include<algorithm>
#include<cstdio>

using namespace std;

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

#define X real()
#define Y imag()

typedef long double D;
typedef complex<D> P;
typedef pair<P, P> L;
typedef vector<P> Pol;

const D INF = 1e40;
const D EPS = 1e-8;
const D PI = acos(-1);

int sig(D r) {return (r < -EPS) ? -1 : (r > EPS) ? 1: 0;}
bool eq(D a, D b) {return abs(a - b) < EPS;}
bool near(P a, P b) {return abs(b - a) < EPS;}

// 内積
D dot(P a, P b) {return a.X * b.X + a.Y * b.Y;}
// 外積
D cross(P a, P b) {return a.X * b.Y - a.Y * b.X;}

// 線分のベクトル
P vec(L a) {return a.second - a.first;}

// 線分abに対する点xの位置
enum CCW{FRONT = 1, RIGHT = 2, BACK = 4, LEFT = 8, ON = 16};
int ccw(L s, P p) {
  P a = vec(s);
  p -= s.first;
  D cr = cross(a, p);
  if (eq(cr, 0)) {
    if (sig(dot(a, p)) < 0) return BACK;
    if (sig(norm(a) - norm(p)) < 0) return FRONT;
    return ON;
  }
  return (cr > 0) ? LEFT : RIGHT;
}

int main() {
  P a, b, c, p;
  while (cin >> a.X >> a.Y >> b.X >> b.Y >> c.X >> c.Y >> p.X >> p.Y) {
    int bit = ccw(L(a, b), p) | ccw(L(b, c), p) | ccw(L(c, a), p);
    if (bit == LEFT || bit == RIGHT) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}