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 rep(i, n) for(int i = 0; i < (int)n; ++i)
#define repf(i, f, l) for(int i = f; i < (int)l; ++i)

#ifdef ONLINE_JUDGE
#define DEBUG false
#else
#define DEBUG true
#endif

#define pb emplace_back
#define lb lower_bound
#define ul unsigned long
#define ull unsigned long long
#define ll long long
#define INF 1000000007
#define MOD 1000000007
#define fs first
#define sd second

#define ALL(c) (c).begin(),(c).end()

#define DBG0(x)    {if(DEBUG){ cout << #x << ": " << x << "\t"; }}
#define DBG(x)     {if(DEBUG){DBG0(x); cout << endl;}}
#define DBG2(x, y) {if(DEBUG){DBG0(x); DBG(y);}}
#define DBG3(x, y, z) {if(DEBUG){DBG0(x); DBG2(y, z);}}
#define DBG4(w, x, y, z) {if(DEBUG){DBG0(w); DBG3(x, y, z);}}

template <class T>
ostream& operator<<(ostream& os, vector<T> xs){ for(T x: xs) os << x << ' '; return os; }
template <class S, class T>
ostream& operator<<(ostream& os, pair<S,T> st){ os << "(" << st.first << "," << st.second <<")"; return os; }

using namespace std;
const double EPS = 1.0e-14;
typedef complex<double> Point;
istream& operator>>(istream& is, Point &pt){
    double a, b;
    is >> a >> b;
    pt.real(a); pt.imag(b);
    return is;
}

ostream& operator<<(ostream& os, const Point &pt){
    os << make_pair(pt.real(), pt.imag());
    return os;
}

inline double cross(const Point &a, const Point &b){
    return (a.real()*b.imag() - a.imag()*b.real());
}

inline double myarg(Point &a){
    double ret = arg(a);
    return (ret >= 0 ? ret : ret + 2*M_PI);
}

inline double signed_area(const Point &a, const Point &b, const Point &c){
    Point ab = b - a;
    Point ac = c - a;
    return cross(ab, ac) / 2.0;
}

inline bool intersect(const Point &a1, const Point &a2, const Point &b1, const Point &b2) {
  return ((cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS) &&
          (cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS));
}

void sort_by_arg(vector<Point> &pts){
    sort(pts.begin(), pts.end(), [](Point a, Point b){ return (myarg(a) < myarg(b)); });
}

double area(vector<Point> &vs){
    int n = vs.size();
    vector<Point> pts(n - 1);
    rep(i, n - 1) pts[i] = vs[i + 1] - vs[0];
    sort_by_arg(pts);
    double ans = 0.0;
    rep(i, n - 1) ans += cross(vs[i], vs[i + 1]);
    return ans / 2.0;
}


typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef vector<bool> vbl;
typedef pair<int, int> pii;

bool counter_clock_wise(const Point &a, const Point &b, const Point &c){
    if(cross(a, b) > 0 && cross(b, c) > 0) return true;
    else return false;
}

int main(void){
    Point a, b, c, p;
    while(cin >> a >> b >> c >> p){
        Point A = b - a;
        Point B = c - a;
        Point P = p - a;
        if(cross(A, P) * cross(P, B) > 0.0)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

#include <complex>
typedef complex<double> Point;

// 誤差を加味した符号判定
int sign(double a){
  if(a > EPS) return +1;
  if(a < -EPS) return -1;
  return 0;
}

// 誤差を加味した同一判定
bool equal(double a, double b){ 
  return abs(b - a) < EPS;
}
bool operator==(const Point& a, const Point& b){
  return equal(a.real(), b.real()) && equal(a.imag(), b.imag());
}

// 比較演算子
namespace std{
  bool operator < (const Point& a, const Point& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}

// 内積・外積
double dot(Point a, Point b){
  return real(conj(a) * b);
}
double cross(Point a, Point b){
  return imag(conj(a) * b);
}

// 点の回転
Point rotate(Point a, double b){
  return a * polar(1.0, b);
}

// 点の進行方向
int ccw(Point a, Point b, Point c) {
  b -= a; c -= a;
  if (cross(b, c) > EPS)   return +1; // 反時計回り
  if (cross(b, c) < -EPS)   return -1; // 時計回り
  if (dot(b, c) < 0)     return +2; // c--a--b の順番で一直線上
  if (norm(b) < norm(c)) return -2; // a--b--c の順番で一直線上
  return 0;                         // a--c--b の順番で一直線上(またはb == c)
}
typedef vector<Point> Polygon;

// Polygonの要素へのアクセス
Point curr(const Polygon& a, int x){ return a[x]; }
Point next(const Polygon& a, int x){ return a[(x + 1) % a.size()]; }
Point prev(const Polygon& a, int x){ return a[(x - 1 + a.size()) % a.size()]; }

// 点が多角形のどこにあるのか判定する
enum { OUT, ON, IN };
int contains(const Polygon& P, const Point& p){
  // 点pから半直線をひき、辺と交差する回数を数える
  bool in = false;
  REP(i, P.size()){
    Point a = curr(P, i) - p;
    Point b = next(P, i) - p;
    if(a.imag() > b.imag()) swap(a, b);
    // aからbの直線がy=0と交わり、その交点は原点の右側である
    if(a.imag() <= 0 && 0 < b.imag() && cross(a, b) < 0){ 
      in = !in;
    }
    if(cross(a, b) == 0 && dot(a, b) <= 0) return ON;
  }
  return in ? IN : OUT;
}

// 多角形の面積
double area(const Polygon& P) {
  double A = 0;
  REP(i, P.size()){
    A += cross(curr(P, i), next(P, i));
  }
  return A / 2.0;
}
int main(){
  while(true){
    Polygon t;
    REP(i, 3){
      double x, y;
      cin >> x >> y;
      t.push_back(Point(x, y));
    }
    if(cin.eof()) break;
    if(ccw(t[0], t[1], t[2]) == -1) swap(t[1], t[2]);
    double x, y; cin >> x >> y;
    if(contains(t, Point(x, y)) == IN) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

double line(double x, double y, double ax, double ay, double bx, double by) {
	return (y-ay)*(bx-ax)-(x-ax)*(by-ay);
}

int main(void) {
	double x1, x2, x3, xp, y1, y2, y3, yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		if (
				line(x1,y1,x2,y2,x3,y3)*line(xp,yp,x2,y2,x3,y3) > 0.0 &&
				line(x2,y2,x3,y3,x1,y1)*line(xp,yp,x3,y3,x1,y1) > 0.0 &&
				line(x3,y3,x1,y1,x2,y2)*line(xp,yp,x1,y1,x2,y2) > 0.0)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}