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 <bits/stdc++.h>
using namespace std;

#define iota(i,n,b,s) for(int i=int(b);i!=int(b+s*n);i+=s)
#define range_debug(i,n,m) (n>m?(n-m+1):(m-n+1))<<n<<(n>m?-1:1)
#define range(i,n,m) iota(i,(n>m?(n-m+1):(m-n+1)),n,(n>m?-1:1))
#define rep(i,n) iota(i,n,0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define trace(var) cout<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef long double Real;
typedef pair<Real, Real> P; // Point
typedef pair<P, P> L; // segment or line
const Real PI = acos(-1);

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

/* inner dot */
Real dot(P&a, P&b) {
  return car(a) * car(b) + cdr(a) * cdr(b);
}
Real operator*(P&a, P&b) {
  return car(a) * car(b) + cdr(a) * cdr(b);
}

/* scalar multiple */
P operator*(P&a, Real c) {
  return cons(c * car(a), c * cdr(a));
}
P operator*(Real c, P&a) {
  return cons(c * car(a), c * cdr(a));
}

Real det(P&a, P&b) {
  return car(a) * cdr(b) - cdr(a) * car(b);
}

/* vector operator */
P operator+(P&a, P&b) {
  return cons(car(a) + car(b), cdr(a) + cdr(b));
}

P operator-(P&a) {
  return cons(-car(a), -cdr(a));
}

P operator-(P&a, P&b) {
  return cons(car(a) - car(b), cdr(a) - cdr(b));
}

/* distance */
Real Manhattan(P&a, P&b) {
  return abs(car(a) - car(b)) + abs(cdr(a) - cdr(b));
}
Real Euclidean(P&a, P&b) {
  P p = a - b;
  return sqrt(pow(car(p), 2) + pow(cdr(p), 2));
}

/* equality with EPS (default: 1e-9) */
bool eq(Real x, Real y) {
  return abs(x - y) < EPS;
}
bool operator==(P&a, P&b) {
  return eq(car(a), car(b)) && eq(cdr(a), cdr(b));
}

int sign(Real a) {
  if (eq(a, 0)) return 0;
  return a > 0 ? 1 : -1;
}

enum CCW {
  FRONT,
  BACK,
  RIGHT,
  LEFT,
  ON
};
CCW ccw(L&l, P&p) {
  P u = car(l);
  P v = cdr(l);

  P dif = p - u;
  P dir = v - u;

  if (eq(0, car(dir))) {
    if (eq(0, car(dif))) {
      Real k = cdr(dif) / cdr(dir);
      if (k > 1.0) return FRONT;
      if (k < 0.0) return BACK;
      return ON;
    } else {
      if (det(dir, dif) > 0.0) {
        return LEFT;
      }
      return RIGHT;
    }
  }

  Real k = car(dif) / car(dir);
  if (eq(cdr(dir) * k, cdr(dif))) {
    if (k > 1.0) return FRONT;
    if (k < 0.0) return BACK;
    return ON;
  } else {
    if (det(dir, dif) > 0.0) {
      return LEFT;
    }
    return RIGHT;
  }
}

Real magnitude(P&a) {
  return sqrt(pow(car(a), 2) + pow(cdr(a), 2));
}

Real arg(P a, P b) {
  Real x = dot(a, b) / magnitude(a) / magnitude(b);
  x = min<Real>(1, max<Real>(-1, x));
  return acos(x);
}

int main() {
  Real x1,y1,x2,y2,x3,y3,xp,yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp, cin) {
    P a(x1, y1);
    P b(x2, y2);
    P c(x3, y3);
    P p(xp, yp);
    Real t0 = arg(b - a, c - a);
    Real t1 = arg(b - a, p - a);
    Real t2 = arg(p - a, c - a);
    if (t1 < t0 && t2 < t0) {
      t0 = arg(c - b, a - b);
      t1 = arg(c - b, p - b);
      t2 = arg(p - b, a - b);
      if (t1 < t0 && t2 < t0) {
        t0 = arg(b - c, a - c);
        t1 = arg(b - c, p - c);
        t2 = arg(p - c, a - c);
        if (t1 < t0 && t2 < t0) {
          cout << "YES" << endl;
          goto more;
        }
      }
    }
    cout << "NO" << endl;
more:;
  }
  return 0;
}

C++: #include <stdio.h>

#define EPSILON 1.0e-6

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

  while (fscanf(stdin,
		"%lf %lf %lf %lf %lf %lf %lf %lf",
		&x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) == 8) {

    double s = (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1);

    double u = ((xp - x1) * (y3 - yp) - (yp - y1) * (x3 - xp)) / s;
    double v = ((x2 - x1) * (yp - y2) - (y2 - y1) * (xp - x2)) / s;

    if (u > -EPSILON && v > -EPSILON && u + v < 1.0 + EPSILON) {
      fputs("YES\n", stdout);
    }
    else {
      fputs("NO\n", stdout);
    }
  }
}

C++: #include <cstdio>
#include <cmath>
using namespace std;
typedef long long lint;

struct point { double x, y; };

int main()
{
    point p[4];

    while (~scanf("%lf %lf", &p->x, &p->y)){
        for (int i = 1; i < 4; i++) scanf("%lf %lf", &p[i].x, &p[i].y);

        double p_side[3], side[3];
        for (int i = 0; i < 3; i++){
            p_side[i] = sqrt((p[i].x - p[3].x) * (p[i].x - p[3].x) + (p[i].y - p[3].y) * (p[i].y - p[3].y));
            side[i] = sqrt((p[(i + 1) % 3].x - p[i].x) * (p[(i + 1) % 3].x - p[i].x) + (p[(i + 1) % 3].y - p[i].y) * (p[(i + 1) % 3].y - p[i].y));
        }

        double p_s[3], s;
        for (int i = 0; i < 3; i++){
            double tmp = (p_side[i] + p_side[(i + 1) % 3] + side[i]) / 2;
            p_s[i] = sqrt(tmp * (tmp - p_side[i]) * (tmp - p_side[(i + 1) % 3]) * (tmp - side[i]));
        }
        double tmp = (side[0] + side[1] + side[2]) / 2;
        s = sqrt(tmp * (tmp - side[0]) * (tmp - side[1]) * (tmp - side[2]));

//        printf("%.20f\n", fabs(s - p_s[0] - p_s[1] - p_s[2]));
        if (fabs(s - p_s[0] - p_s[1] - p_s[2]) < 1e-10) puts("YES");
        else puts("NO");
    }

    return 0;
}