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>

class Vec {
private:
    double m_x;
    double m_y;

public:
    Vec(double x, double y)
        : m_x(x), m_y(y) {}

    double x() const { return m_x; }
    double y() const { return m_y; }

    double operator*(Vec& vec)
    {
        return (m_x * vec.y() - m_y * vec.x());
    }
};

int sign(double x);

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

    while (std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        Vec vec12(x2 - x1, y2 - y1);
        Vec vec1p(xp - x1, yp - y1);
        Vec vec23(x3 - x2, y3 - y2);
        Vec vec2p(xp - x2, yp - y2);
        Vec vec31(x1 - x3, y1 - y3);
        Vec vec3p(xp - x3, yp - y3);

        double cross01 = vec12 * vec1p;
        double cross02 = vec23 * vec2p;
        double cross03 = vec31 * vec3p;
        int judge = sign(cross01) + sign(cross02) + sign(cross03);

        if (judge == 1 + 1 + 1 || judge == -1 - 1 - 1) {
            std::cout << "YES" << std::endl;
        } else {
            std::cout << "NO" << std::endl;
        }
    }

    return 0;
}

int sign(double x)
{
    return ((x >= 0)? 1: (-1));
}

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

using namespace std;
typedef pair<double, double> P;

double helon(P p1, P p2, P p3)
{
	double a = sqrt((p1.first - p2.first) * (p1.first - p2.first) + (p1.second - p2.second) * (p1.second - p2.second));
	double b = sqrt((p2.first - p3.first) * (p2.first - p3.first) + (p2.second - p3.second) * (p2.second - p3.second));
	double 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 xp;
	while(cin >> p[0].first >> p[0].second >> p[1].first >> p[1].second >> p[2].first >> p[2].second >> xp.first >> xp.second)
	{
		double square1 = helon(p[0], p[1], p[2]);
		double square2 = helon(p[0], p[1], xp);
		double square3 = helon(p[0], p[2], xp);
		double square4 = helon(p[1], p[2], xp);
		if(fabs(square1 - square2 - square3 - square4) < 1e-8)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

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

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <cstdlib>
#include <queue>
#include <vector>
#include <set>
#include <stdio.h>
#include <cstdio>
#include <cmath>
#include <complex> 
using namespace std;
typedef complex<double> xy_t;
xy_t P[4];
double x,y;
double a,b,c;
int main() {
	int i=0;
while (cin >> x >> y) {
	P[i] = xy_t(x,y);
	i += 1;
	if (i == 4) {
	a =  ((P[0]-P[3]).real()*(P[1]-P[3]).imag()-(P[0]-P[3]).imag()*(P[1]-P[3]).real())/2;
	b =  ((P[1]-P[3]).real()*(P[2]-P[3]).imag()-(P[1]-P[3]).imag()*(P[2]-P[3]).real())/2;
	c =  ((P[2]-P[3]).real()*(P[0]-P[3]).imag()-(P[2]-P[3]).imag()*(P[0]-P[3]).real())/2;
	bool p = a*b > 0 && b*c > 0;
cout << (p ? "YES" : "NO") << endl;
i = 0;
}
}
}

C++: #include <bits/stdc++.h>
using namespace std;

using ld = long double;
const ld eps = 1e-8, pi = acos(-1.0);

bool eq(ld a, ld b) {
	return abs(a - b) < eps;
}

using Point = complex<ld>;
class Line {
public:
	Point a, b;
};
ld dot(Point a, Point b) {
	return real(conj(a) * b);
}

ld cross(Point a, Point b) {
	return imag(conj(a) * b);
}

int ccw(Point a, Point b, Point c) {
	b -= a, c -= a;
	if (cross(b, c) > eps) return 1;	// a,b,c??????????¨???¨???
	if (cross(b, c) < -eps) return -1;	// a,b,c???????¨???????
	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???????????´???
}


int main()
{
	ld x1, x2, x3, xp, y1, y2, y3, yp;
	Point p1, p2, p3, P;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		p1 = Point(x1, y1);
		p2 = Point(x2, y2);
		p3 = Point(x3, y3);
		if (ccw(p1, p2, p3) == -1) {
			swap(p2, p3);
		}
		P = Point(xp, yp);
		cout << (ccw(p1, p2, P) == 1 && ccw(p2, p3, P) == 1 && ccw(p3, p1, P) == 1 ? "YES" : "NO") << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define EPS (1e-10)
#define equal(a,b) (fabs((a)-(b)) < EPS)

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( a*x , a*y );
  }

  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 equal( x,p.x )&& equal( y,p.y );
  }
};

typedef Point Vector;

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 - b.x*a.y;
}

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( a.norm() < b.norm() ) return ONLINE_FRONT;
  return ON_SEGMENT;
}

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

  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    int a = ccw(Point(x1,y1),Point(x2,y2),Point(xp,yp));
    int b = ccw(Point(x2,y2),Point(x3,y3),Point(xp,yp));
    int c = ccw(Point(x3,y3),Point(x1,y1),Point(xp,yp));

    if(a == b && b == c) cout << "YES" << endl;
    else cout << "NO" << endl;
  }  

  return 0;
}

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

#define P(a) ((a)*(a))
using namespace std;

typedef struct {
    double x;
    double y;
}Point;

double length(Point a,Point b){
    return sqrt(P(b.x-a.x)+P(b.y-a.y));
}

double heron(Point a,Point b,Point c){
    double d,e,f,s;
    d=length(a,b);
    e=length(b,c);
    f=length(c,a);
    s=(d+e+f)/2.0;
    return sqrt(s*(s-d)*(s-e)*(s-f));
}
int main(){
    Point p[3],q;

    while(cin >> p[0].x >> p[0].y >> p[1].x >> p[1].y >> p[2].x >> p[2].y >> q.x >> q.y){
        double Tarea,Carea;
        Tarea=heron(p[0], p[1], p[2]);
        Carea=heron(p[0],p[1],q)+heron(p[1],p[2],q)+heron(p[2],p[0],q);
        if(fabs(Tarea-Carea)<=0.0000000000001) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}