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>
using namespace std;
struct Point { long double px, py; };
long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; }
long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; }
long double norm(Point a) { return a.px*a.px + a.py*a.py; }
Point Minus(Point p1, Point p2) {
	Point A1; 
	A1.px = p1.px - p2.px;
	A1.py = p1.py - p2.py;
	return A1;
}
int ccw(Point p0, Point p1, Point p2) {
	Point a = Minus(p1, p0), b = Minus(p2, p0);
	if (crs(a, b) > 1e-10) return 1;
	if (crs(a, b) < -1e-10) return -1;
	if (dot(a, b) < -1e-10) return 2;
	if (norm(a) < norm(b)) return -2;
	return 0;
}
bool its(Point p1, Point p2, Point p3, Point p4) {
	return (ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 && ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0);
}
Point P1, P2, P3, P4;
int main() {
	while (cin >> P1.px >> P1.py >> P2.px >> P2.py >> P3.px >> P3.py >> P4.px >> P4.py) {
		int OK = 0;
		if (its(P1, P2, P3, P4) == true) { OK = 1; }
		if (its(P1, P3, P2, P4) == true) { OK = 1; }
		if (its(P1, P4, P2, P3) == true) { OK = 1; }
		if (OK == 1) { cout << "NO" << endl; }
		else { cout << "YES" << endl; }
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

bool flag;
double x1, yt1, x2, y2, x3, y3, xp, yp;
double v[3][2];

double inpr(double v1[2], double v2[2]) {
	double ret = v1[0] * v2[0] + v1[1] * v2[1];
	return ret;
}

int main() {
	x2 = -123456;
	cin >> x1 >> yt1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;

	while (x2 != -123456) {
		flag = true;
		v[0][0] = -(y2 - yt1);
		v[0][1] = x2 - x1;		
		
		v[1][0] = x3 - x1;
		v[1][1] = y3 - yt1;

		v[2][0] = xp - x1;
		v[2][1] = yp - yt1;

		if (inpr(v[0], v[1]) * inpr(v[0], v[2]) < 0) flag = false;
		
		v[0][0] = -(y3 - y2);
		v[0][1] = x3 - x2;		
		
		v[1][0] = x1 - x2;
		v[1][1] = yt1 - y2;

		v[2][0] = xp - x2;
		v[2][1] = yp - y2;

		if (inpr(v[0], v[1]) * inpr(v[0], v[2]) < 0) flag = false;
		
		v[0][0] = -(yt1 - y3);
		v[0][1] = x1 - x3;		
		
		v[1][0] = x2 - x3;
		v[1][1] = y2 - y3;

		v[2][0] = xp - x3;
		v[2][1] = yp - y3;

		if (inpr(v[0], v[1]) * inpr(v[0], v[2]) < 0) flag = false;

		if (flag) cout << "YES" << endl;
		else cout << "NO" << endl;

		x2 = -123456;
		cin >> x1 >> yt1 >> x2 >> y2 >> x3 >> y3;
	}

	return 0;
}

/*@@@@@@@@@@@@@@@@@@@@@@@@@*/
/*@                       @*/
/*@ debug output erased ? @*/
/*@                       @*/
/*@@@@@@@@@@@@@@@@@@@@@@@@@*/

C++: //二次元幾何ライブラリ
#include <iostream>
#include <complex>
#include <map>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define X real()
#define Y imag()
typedef long double D;
typedef bool B;
typedef complex<D> P;   //点
typedef complex<D> V;   //ベクトル
typedef pair<P,P>  L;   //直線
typedef pair<P,D>  C;   //円
typedef vector<P>  Pol; //多角形

//変数名定義
const D INF = 1e100;
const D EPS = 1e-8;
const D PI = acos(-1);

template<class T> bool operator==(T a, T b){return abs(a - b )< EPS;}
template<class T> int sig(T r) {return (r==0||r==-0) ? 0 : r > 0 ? 1 : -1;}

  bool operator < (const P& a, const P& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }

// ベクトルaの絶対値を求める
// D Length = abs(a);

// 2点a,b間の距離を求める
// D Distance = abs(a-b); 

// 内積 (Inner Product) : a・b = |a||b|cosθ
D IP(V a, V b) {
	return (a.real() * b.real() + a.imag() * b.imag());
}

// 外積 (Exterior Product) : a×b = |a||b|sinθ
D EP(V a, V b) {
	return (a.real() * b.imag() - a.imag() * b.real());
}

// 点の進行方向について 3
int ccw(P a, P b, P c) {              //点aと点bが与えられた問いに
  b -= a; c -= a;
  if (EP(b, c) > EPS)   return +1;      // counter clockwise
  if (EP(b, c) < -EPS)   return -1;      // clockwise
  if (IP(b, c) < -EPS)     return +2;    // c--a--b on line
  if (norm(b) < norm(c)) return -2;   // a--b--c on line
  return 0;                           // a--c--b on line  aとbの線分判定はこれ
}

int main(void){
	while(true){
		P point[4];	
		int tmp;
		rep(j,4)
		cin >> point[j].X >> point[j].Y;
		rep(j,4)
			cout << point[j].X <<" "<<point[j].Y <<endl;
		if(cin.eof())
			break;
		int ccw1,ccw2,ccw3;
		ccw1=ccw(point[0],point[1],point[3]);
		ccw2=ccw(point[1],point[2],point[3]);
		ccw3=ccw(point[2],point[0],point[3]);
		if(ccw1==ccw2&&ccw2==ccw3)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

C++: #include <stdio.h>

double cr(double x1, double y1, double x2, double y2) {
	return x1*y2-x2*y1;
}

int main()
{
	for(;;) {
		double x[4], y[4];
		if (scanf("%lf %lf %lf %lf %lf %lf %lf %lf",
					x, y, x+1, y+1, x+2, y+2, x+3, y+3)==EOF) {
			return 0;
		}
		else {
			double cr1 = cr(x[3]-x[0], y[3]-y[0], x[3]-x[1], y[3]-y[1]);
			double cr2 = cr(x[3]-x[1], x[3]-y[1], x[3]-x[2], y[3]-x[2]);
			double cr3 = cr(x[3]-x[2], x[3]-y[2], x[3]-x[0], y[3]-x[0]);
			if (cr1*cr2>=0 && cr2*cr3>=0) printf("YES\n");
			else printf("NO\n");
		}
	}
}

C++: #include <iostream>

using namespace std;

int islineCross(double x1, double y1, double x2, double y2, double c1, double c2, double d1, double d2) {
  if (((c2-y1)*(x1-x2)-(c1-x1)*(y1-y2))*((d2-y1)*(x1-x2)-(d1-x1)*(y1-y2)) > 0)
    return -1;
  else
    return 0;
}

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

  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    int CrossCount = 0;
    if (islineCross(x1,y1,x2,y2,xp,yp,xp+100,yp) == 0)
      CrossCount++;
    if (islineCross(x2,y2,x3,y3,xp,yp,xp+100,yp) == 0)
      CrossCount++;
    if (islineCross(x1,y1,x3,y3,xp,yp,xp+100,yp) == 0)
      CrossCount++;
    
    if (CrossCount == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } 

  return 0;
}

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

using namespace std;

struct Vector
{
public:
	double x;
	double y;

public:
	inline Vector()
	{

	}
	
	inline Vector(const int& x, const int& y) :
		x(x),
		y(y)
	{

	}
};

istream& operator>>(std::istream& stream, Vector& vector)
{
	stream >> vector.x >> vector.y;
	return stream;
}

struct Segment
{
public:
	Vector begin;
	Vector end;

public:
	inline Segment(const Vector& begin, const Vector& end) :
		begin(begin.x, begin.y),
		end  (end  .x, end  .y)
	{

	}
};

bool isLeft(Segment segment, Vector point)
{
	return (segment.end.x - segment.begin.x)*(point.y - segment.begin.y) - (segment.end.y - segment.begin.y) * (point.x - segment.begin.x) > 0;
}

int main()
{
	Vector A, B, C, P;
	while(cin >> A >> B >> C >> P)
	{
		if( isLeft(Segment(A, B), P) && isLeft(Segment(B, C), P) && isLeft(Segment(C, A), P) )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}