Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <complex>

using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59
using Point = complex<double>;
istream &operator>>(istream &is, Point &p)
{
    double a, b;
    is >> a >> b;
    p = Point(a, b);
    return is;
}

ostream &operator<<(ostream &os, Point &p)
{
    os << fixed << setprecision(10) << p.real() << " " << p.imag();
}

const double EPS = 1e-10, PI = acos(-1);
inline bool eq(double a, double b) { return fabs(b - a) < EPS; }

//二つのスカラーが等しいか
#define EQ(a, b) (abs((a) - (b)) < EPS)
//二つのベクトルが等しいか
#define EQV(a, b) (EQ((a), real(), (b).real()) && EQ((a), imag(), (b).imag()))

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

struct Line
{
    Point a, b;
    Line() {}
    Line(Point a, Point b) : a(a), b(b) {}
    //a, bはそれぞれ座標を指す. これより一つの「line」に対して二個の点を持つことになる
    Line(double A, double B, double C) // Ax + By = C
    {
        if (eq(A, 0))
            a = Point(0, C / B), b = Point(1, C / B);
        else if (eq(B, 0))
            b = Point(C / A, 0), b = Point(C / A, 1);
        else
            a = Point(0, C / B), b = Point(C / A, 0);
    }

    friend ostream &operator<<(ostream &os, Line &p)
    {
        return os << p.a << " to " << p.b;
    }

    friend istream &operator>>(istream &is, Line &a)
    {
        return is >> a.a >> a.b;
    }
};

struct Segment : Line
{
    Segment() {}

    Segment(Point a, Point b) : Line(a, b) {}
};

using Points = vector<Point>;
using Polygon = vector<Point>;
using Segments = vector<Segment>;
using Lines = vector<Line>;

double dot(const Point a, const Point b)
{
    return real(a) * real(b) + imag(a) * imag(b);
}

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

int ccw(const Point &a, Point b, Point c)
{
    b = b - a, c = c - a;
    if (cross(b, c) > EPS)
        return +1; // "COUNTER_CLOCKWISE"
    if (cross(b, c) < -EPS)
        return -1; // "CLOCKWISE"
    if (dot(b, c) < 0)
        return +2; // "ONLINE_BACK"
    if (norm(b) < norm(c))
        return -2; // "ONLINE_FRONT"
    return 0;      // "ON_SEGMENT"
}
enum
{
    OUT,
    ON,
    IN
};

int contains(const Polygon &Q, const Point &p)
{
    bool in = false;
    for (int i = 0; i < Q.size(); ++i)
    {
        Point a = Q[i] - p, b = Q[(i + 1) % Q.size()] - p;
        if (a.imag() > b.imag())
            swap(a, b);
        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;
}

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    Point p1, p2, p3, p4;

    while (cin >> p1 >> p2 >> p3 >> p4)
    {
        Polygon v;
        v.push_back(p1);
        v.push_back(p2);
        v.push_back(p3);

        if (contains(v, p4))
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }

    return 0;
}

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

using namespace std;
typedef pair<double, double> P;
static const double eps = 1.0e-9;

double Helon(P p1, P p2, P p3)
{
	double a, b, c;
	a = sqrt((p1.first - p2.first) * (p1.first - p2.first) + (p1.second - p2.second) * (p1.second - p2.second));
	b = sqrt((p2.first - p3.first) * (p2.first - p3.first) + (p2.second - p3.second) * (p2.second - p3.second));
	c = sqrt((p3.first - p1.first) * (p3.first - p1.first) + (p3.second - p1.second) * (p3.second - p1.second));
	double s = (a + b + c) / 2;
	return(sqrt(s * (s - a) * (s - b) * (s - c)));
}

void solve()
{
	P p[3];
	P pp;
	while(cin >> p[0].first)
	{
		cin >> p[0].second;
		for(int i = 1; i < 3; ++i)
		{
			cin >> p[i].first >> p[i].second;
		}
		cin >> pp.first >> pp.second;
		double sum1 = 0;
		sum1 = Helon(p[0], p[1], p[2]);
		double sum = 0;
		sum += Helon(p[0], p[1], pp);
		sum += Helon(p[1], p[2], pp);
		sum += Helon(p[2], p[0], pp);
		if(fabs(sum1 - sum) < eps)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <complex>
using namespace std;
typedef complex<double> P;

double det(P a, P b) {
  return (conj(a)*b).imag();
}
double solve(P a,P b,P p) {
  return (conj(p)*b).imag()/det(a,b);
}
int main() {
  P a,b,c,p;
  while(cin>>a.real()>>a.imag()>>b.real()>>b.imag()>>c.real()>>c.imag()>>p.real()>>p.imag()) {
    double s=solve(b-a,c-a,p-a),t=solve(c-a,b-a,p-a);
    cout << ( 0<s&&s<1 && 0<t&&t<1 && s+t<1 ?"YES":"NO") << endl; // テヲツ閉ーテ・ツュツヲBテ」ツδ凖」ツつッテ」ツδ暗」ツδォテ」ツ?ョテ、ツクツ嘉ィツァツ津・ツスツ「テ・ツ??ゥツδィテ」ツ?ョテヲツ敖。テ、ツサツカテ・ツシツ湘」ツつ津ィツ、ツ?ァツエツ?・ツケツウテゥツ敖「テ、ツクツ甘」ツ?ァテ・ツ按ゥテァツ板ィ
  }
  return 0;

}