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

using namespace std;

const int EPS=1e-9;

namespace FP {
    bool isZero(double x) {
        return (abs(x) <= EPS);
    }
};

struct Point {
    double x, y;
    Point(double x=0, double y=0) : x(x), y(y) {}
    string to_s() {
        ostringstream os;
        os << "(" << x << "," << y << ")";
        return os.str();
    }
    bool operator<(const Point &o) const {
        return x == o.x ? y < o.y : x < o.x;
    }
    Point operator+(const Point &o) const {
        return Point(x+o.x, y+o.y);
    }
    Point operator-(const Point &o) const {
        return Point(x-o.x, y-o.y);
    }
    Point operator*(const double m) const {
        return Point(x*m, y*m);
    }
    Point operator/(const double d) const {
        return Point(x/d, y/d);
    }
    // 外積
    double cross(const Point &o) const {
        return x * o.y - y * o.x;
    }
    // 内積
    double dot(const Point &o) const {
        return x * o.x + y * o.y;
    }
    // ベクトルがx軸となす角
    double atan() const {
        return atan2(y, x);
    }
    // ベクトルの長さの二乗
    double norm() const {
        return dot(*this);
    }
};

struct Line {
    double a, b, c;
    Line(double a=0, double b=0, double c=0) :
        a(a), b(b), c(c) {}
    Point intersectionPoint(const Line &l) const {
        double d = a * l.b - l.a * b;
        if (!intersects(l)) {
            throw string("The 2 Lines are parallel");
        }
        double x = (b * l.c - l.b * c) / d;
        double y = (l.a * c - a * l.c) / d;
        return Point(x, y);
    }
    bool intersects(const Line &l) const {
        return !FP::isZero(a * l.b - l.a * b);
    }
    string to_s() {
        ostringstream os;
        os << a << ' ' << b << ' ' << c;
        return os.str();
    }
    static Line fromPoints(const Point &a, const Point &b) {
        double dx = b.x - a.x;
        double dy = b.y - a.y;
        return Line(dy, -dx, dx * a.y - dy * a.x);
    }
    static Line fromPoints(double x1, double y1, double x2, double y2) {
        return fromPoints(Point(x1, y1), Point(x2, y2));
    }
};

struct LineSegment {
    Point start, end;
    LineSegment(const Point &start, const Point &end) : start(start), end(end) {}
    LineSegment(double x1, double y1, double x2, double y2) : start(Point(x1, y1)), end(Point(x2, y2)) {}
    string to_s() {
        ostringstream os;
        os << '(' << start.x << ',' << start.y << ')' << '-' << '(' << end.x << ',' << end.y << ')' << endl;
        return os.str();
    }
    Line toLine() const {
        return Line::fromPoints(start, end);
    }
    bool intersects(const Line &l) const {
        double t1 = l.a * start.x + l.b * start.y + l.c;
        double t2 = l.a * end.x + l.b * end.y + l.c;
        return t1 * t2 <= 0;
    }
    bool intersects(const LineSegment &s) const {
        return intersects(s.toLine()) && s.intersects(toLine());
    }
    Line perpendicularBisector() const {
        Point p1 = (start + end) / 2;
        Point p2;
        p2.x = -(end - p1).y;
        p2.y = (end - p1).x;
        p2 = p2 + p1;
        return Line::fromPoints(p1, p2);
    }
};

int main() {
    Point v[3], p;
    while (cin >> v[0].x >> v[0].y) {
        for (int i = 1; i < 3; i++) cin >> v[i].x >> v[i].y;
        cin >> p.x >> p.y;
        Point g = (v[0] + v[1] + v[2]) / 3;
        vector<LineSegment> e;
        e.push_back(LineSegment(v[0], v[1]));
        e.push_back(LineSegment(v[1], v[2]));
        e.push_back(LineSegment(v[2], v[0]));

        bool inner_triangle = true;
        for (int i = 0; i < 3; i++) {
            if (LineSegment(g, p).intersects(e[i])) {
                inner_triangle = false;
            }
        }

        if (inner_triangle) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

bool tri_in(double p0x, double p0y, double p1x, double p1y, double p2x, double p2y, double px, double py) {
	//(p0x, p0y),(p1x, p1y),(p2x, p2y)の三角形
	//(px, py)が判定したい点
	//辺上は入っている
	double Area = 0.5 * (-p1y * p2x + p0y * (-p1x + p2x) + p0x * (p1y - p2y) + p1x * p2y);
	double s = 1 / (2 * Area) * (p0y * p2x - p0x * p2y + (p2y - p0y) * px + (p0x - p2x) * py);
	double t = 1 / (2 * Area) * (p0x * p1y - p0y * p1x + (p0y - p1y) * px + (p1x - p0x) * py);

	if ((0 <= s)&&(s <= 1) && (0 <= t)&&(t <= 1) && (0 <= 1 - s - t)&&(1 - s - t <= 1)) {
		return true; //Inside Triangle
	}
	else {
		return false;
	}
}


int main() {
	
	double p0x, p0y, p1x, p1y, p2x, p2y, px, py;
	while (cin >> p0x >> p0y >> p1x >> p1y >> p2x >> p2y >> px >> py) {
		if (tri_in(p0x, p0y, p1x, p1y, p2x, p2y, px, py)) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve
double x[4], y[4];

double calc(int i, int j, int k){
  return 0.5 * abs((x[j] - x[i]) * (y[k] - y[i]) - (x[k] - x[i]) * (y[j] - y[i]));
}

int main(int argc, char const* argv[])
{
  while(cin >> x[0]){
    cin >> y[0];
    FOR(i, 1, 4){
      cin >> x[i] >> y[i];
    }
    double area = calc(0, 1, 2);
    double tmp = calc(0, 1, 3) + calc(0, 2, 3) + calc(1, 2, 3);
    if(abs(area - tmp) < EPS){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
	return 0;
}