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 <cfloat>
#include <cmath>
#include <vector>

using namespace std;

#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b)) < EPS)
#define dle(a,b) (equals(a, b) || a < b)
static const double PI = acos(-1);

class Point {
 public:
  double x, y;
  
  Point (double x = 0, double y = 0): x(x), y(y){}
  
  Point operator + ( Point p ){ return Point(x + p.x, y + p.y); }
  Point operator - ( Point p ){ return Point(x - p.x, y - p.y); }
  Point operator * ( double a ){ return Point(x*a, y*a); }
  
  double abs() { return sqrt(norm()); }
  double norm() { return x*x+y*y; }
  
  bool operator < ( const Point &p ) const {
    return x != p.x ? x < p.x : y < p.y;
  }
  
  bool operator == ( const Point &p ) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};

typedef Point Vector;

class Segment {
public:
  Point p1, p2;
  Segment(Point s = Point(), Point t = Point()): p1(s), p2(t) {}
};

double norm( Vector a ) { return a.x*a.x + a.y*a.y; }
double abs( Vector a ) { return sqrt(norm(a)); }
double getDistance( Vector a, Vector b ) { return a.x*b.x + a.y*b.y; }
double dot( Vector a, Vector b ) { return a.x*b.x + a.y*b.y; }
double cross( Vector a, Vector b ) { return a.x*b.y - a.y*b.x; }

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

int ccw( Point p0, Point p1, Point p2 ) {
  Vector a = p1 - p0;
  Vector b = p2 - p0;
  if( cross(a, b) > EPS ) return COUNTER_CLOCKWISE;
  if( cross(a, b) < -EPS ) return CLOCKWISE;
  if( dot(a, b) < -EPS ) return ONLINE_BACK;
  if( norm(a) < norm(b) ) return ONLINE_FRONT;
  return ON_SEGMENT;
}

int main() {
  double x1, y1, x2, y2, x3, y3, x, y;
  
  while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x>>y) {
    int ccw1 = ccw( Point(x1,y1), Point(x2,y2), Point(x,y) );
    int ccw2 = ccw( Point(x2,y2), Point(x3,y3), Point(x,y) );
    int ccw3 = ccw( Point(x3,y3), Point(x1,y1), Point(x,y) );
    if( ccw1 == ccw2 && ccw2 == ccw3 ) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  
  return 0;
}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>

using namespace std;

typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;

int tx[] = {0,1,0,-1};
int ty[] = {-1,0,1,0};

static const double EPS = 1e-8;

class Point{
public:
	double x;
	double y;
	Point(double _x, double _y) : x(_x), y(_y) {}
};

bool isInterSect(const Point& p1,const Point& p2,const Point& p3,const Point& p4){
	    if (((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)) < 0){
			if (((p3.x - p4.x) * (p1.y - p3.y) + (p3.y - p4.y) * (p3.x - p1.x)) * 
            ((p3.x - p4.x) * (p2.y - p3.y) + (p3.y - p4.y) * (p3.x - p2.x)) < 0){
				return true;
			}
		}

		return false;
}

int main(){
	double x1,y1,x2,y2,x3,y3;
	double xp,yp;
	while(~scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)){
		double mx = (x1+x2+x3)/3.0;
		double my = (y1+y2+y3)/3.0;
		if(!isInterSect(Point(x1,y1),Point(x2,y2),Point(xp,yp),Point(mx,my))
			&& !isInterSect(Point(x2,y2),Point(x3,y3),Point(xp,yp),Point(mx,my))
			&& !isInterSect(Point(x3,y3),Point(x1,y1),Point(xp,yp),Point(mx,my))){
				printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}
}

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

using namespace std;

int main(){
  double x[3], y[3], p[2];

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

    // pを(0,0)として三角形の位置をづらす
    for(int i = 0; i < 3; i++){
      x[i] -= p[0];
      y[i] -= p[1];
    }

    // 辺の長さ
    double triEdge[3];
    double pEdge[3];
    // 12 23 31
    for(int i = 0; i < 3; i++){
      triEdge[i] = sqrt(pow(x[i % 3] - x[(i + 1) % 3], 2)
		     + pow(y[i % 3] - y[(i + 1) % 3], 2));
    }

    // 1p 2p 3p
    for(int i = 0; i < 3; i++){
      pEdge[i] = sqrt(pow(x[i], 2) + pow(y[i], 2));
    }
    
    // ヘロンの公式
    double s;
    double ans;
    // 123の面積
    s = (triEdge[0] + triEdge[1] + triEdge[2]) / 2;
    ans = sqrt(s * (s - triEdge[0])*(s - triEdge[1])
	       *(s - triEdge[2]));

    double area;
    // p12の面積
    s = (triEdge[0] + pEdge[0] + pEdge[1]) / 2;
    area = sqrt(s * (s - triEdge[0])*(s - pEdge[0])
	       *(s - pEdge[1]));

    // p13の面積
    s = (pEdge[0] + pEdge[2] + triEdge[2]) / 2;
    area += sqrt(s * (s - pEdge[0])*(s - pEdge[2])
	       *(s - triEdge[2]));

    // p23の面積
    s = (pEdge[1] + triEdge[1] + pEdge[2]) / 2;
    area += sqrt(s * (s - pEdge[1])*(s - triEdge[1])
	       *(s - pEdge[2]));
    
    if(fabs(ans - area) < 0.00001){
      cout << "YES" << endl;
    }
    else{
      cout << "NO" << endl;
    }
    
   
  }
  return 0;
}

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

constexpr double pi = 3.14159265358979323846;

struct vec2d
{
    double x, y;

    double dot(vec2d const & other)
    {
        return x * other.x + y * other.y;
    }

    double norm()
    {
        return sqrt(x * x + y * y);
    }
};

int main()
{
    double x1, y1, x2, y2, x3, y3, xp, yp;

    vec2d v12, v23, v31;
    vec2d v1p, v2p, v3p;
    double a121p, a232p, a313p;

    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        v12 = vec2d{x2 - x1, y2 - y1};
        v23 = vec2d{x3 - x2, y3 - y2};
        v31 = vec2d{x1 - x3, y1 - y3};

        v1p = vec2d{xp - x1, yp - y1};
        v2p = vec2d{xp - x2, yp - y2};
        v3p = vec2d{xp - x3, yp - y3};

        a121p = acos(v12.dot(v1p) / (v12.norm() * v1p.norm()));
        a232p = acos(v23.dot(v2p) / (v23.norm() * v2p.norm()));
        a313p = acos(v31.dot(v3p) / (v31.norm() * v3p.norm()));

        if (a121p <= pi / 2 && a232p <= pi / 2 && a313p <= pi / 2) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

    return 0;
}