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 <bits/stdc++.h>

using namespace std;

class D3
{
public:
	double x;
	double y;
	double z;

	//?????????????????????
	D3 ( double x_ = 0.0 , double y_ = 0.0 , double z_ = 0.0 )
	{
		x = x_;
		y = y_;
		z = z_;
	}

	//??????
	D3 Cross_product ( D3 partner )
	{
		D3 ret ( y*partner.z - z*partner.y , z*partner.x - x*partner.z , x*partner.y - y*partner.x );
		return ret;
	}

	//??????
	double Inner_product ( D3 partner )
	{
		return x*partner.x + y*partner.y + z*partner.z;
	}

	//?????????????????????????????????
	D3 Make_vector ( D3 partner )
	{
		D3 ret ( partner.x - x , partner.y - y , partner.z - z );
		return ret;
	}

	//???????§????2????????????????????¢???????±???????
	double S_vec ( D3 A , D3 B )
	{
		D3 G;
		G = A.Cross_product ( B );
		return sqrt ( G.Inner_product ( G ) ) / 2;
	}

	//??????????????¢???????±???????
	double S_point ( D3 A , D3 B , D3 C )
	{
		return S_vec ( A.Make_vector ( B ) , A.Make_vector ( C ) );
	}

	//???????§????3????????????????????????????±???????
	double V_vec ( D3 A , D3 B , D3 C )
	{
		D3 G;
		G = A.Cross_product ( B );
		return G.Inner_product ( C ) / 6;
	}

	//4???????????????????±???????
	double V_point ( D3 A , D3 B , D3 C , D3 D )
	{
		return V_vec ( A.Make_vector ( B ) , A.Make_vector ( C ) , A.Make_vector ( D ) );
	}

	D3 operator+( D3 partner )
	{
		return D3 ( x + partner.x , y + partner.y , z + partner.z );
	}

	D3 operator-( D3 partner )
	{
		return D3 ( x - partner.x , y - partner.y , z - partner.z );
	}

	D3 operator*( D3 partner )
	{
		return D3 ( x * partner.x , y * partner.y , z * partner.z );
	}

	D3 operator/( D3 partner )
	{
		return D3 ( x / partner.x , y / partner.y , z / partner.z );
	}

	D3 operator*( double d )
	{
		return D3 ( x * d , y * d , z * d );
	}

	D3 operator/( double d )
	{
		return D3 ( x / d , y / d , z / d );
	}

	bool operator==( D3 partner )
	{
		return x == partner.x&&y == partner.y&&z == partner.z;
	}

	double length ()
	{
		return sqrt ( x*x + y*y + z*z );
	}

	//???????????????????????????
	//????????¨???
	D3 Unit_vec ()
	{
		return D3 ( *this ) / ( *this ).length ();
	}

	//????????????????????????
	D3 Inverse_vec ()
	{
		return D3 ( *this )*-1;
	}

	//?????´????????????
	bool Vertical ( D3 partner )
	{
		return ( *this ).Inner_product ( partner ) == 0;
	}

	//??????????????????
	bool Parallel ( D3 partner )
	{
		return ( *this ).Unit_vec () == partner.Unit_vec () || ( *this ).Unit_vec ().Inverse_vec () == partner.Unit_vec ();
	}

};

int main ()
{
	double x1 , y1 , x2 , y2 , x3 , y3 , xp , yp;
	while( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp )
	{
		D3 X ( x1 , y1 ) , Y ( x2 , y2 ) , Z ( x3 , y3 ) , P ( xp , yp ) , calc;
		if( calc.S_point ( X , Y , Z ) - ( calc.S_point ( X , Y , P ) + calc.S_point ( X , Z , P ) + calc.S_point ( Z , Y , P ) ) < 1e-9 )
		{
			cout << "YES" << endl;
		} else
		{
			cout << "NO" << endl;
		}
	}

}

C++: #include <stdio.h>
#include <math.h>

using namespace std;

//I searched this method by WEB.

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

	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
		calc1 = (x1-xp)*(y2-yp)-(y1-yp)*(x2-xp);

		calc2 = (x3-xp)*(y1-yp)-(y3-yp)*(x1-xp);

		calc3 = (x2-xp)*(y3-yp)+(y2-yp)*(x2-xp);

		if((calc1>0&&calc2>0&&calc3>0) || (calc1<0&&calc2<0&&calc3<0)){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
    return 0;
}

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) > 0)   return +1;      // counter clockwise
  if (EP(b, c) < 0)   return -1;      // clockwise
  if (IP(b, c) < 0)     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){
		if(cin.eof())
			break;
		P point[4];	
		int tmp;
		rep(j,4)
		cin >> point[j].X >> point[j].Y;
		bool flag=true;
		for(int i=0;i<3;i++)
			if(ccw(point[i%3],point[(i+1)%3],point[(i+2)%3])!=ccw(point[i%3],point[(i+1)%3],point[3]))
				flag=false;
		if(flag)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

template <typename T>
struct Vector2
{
// variable
public:
	T x;
	T y;

// structor
public:
	Vector2(const Vector2& other) :
		x(other.x),
		y(other.y)
	{

	}

	Vector2(T x = 0, T y = 0) :
		x(x),
		y(y)
	{

	}

// operator
public:
	Vector2 operator-(const Vector2<T>& rhs) const
	{
		return Vector2(x - rhs.x, y - rhs.y);
	}

	Vector2& operator=(const Vector2<T>& rhs)
	{
		x = rhs.x;
		y = rhs.y;
		return *this;
	}
};

template <typename T>
ostream& operator<< (ostream& stream, const Vector2<T>& rhs)
{
	stream << '(' << rhs.x << ", " << rhs.y << ')';
	return stream;
}

template <typename T>
istream& operator>> (istream& stream, Vector2<T>& rhs)
{
	stream >> rhs.x >> rhs.y;
	return stream;
}

template <typename T>
int relation(const Vector2<T>& p1, const Vector2<T>& p2)
{
	T product = p1.x * p2.y - p1.y * p2.x;
		
	return
		product == 0 ? 0 : (product > 0 ? 1 : -1);
}

int main()
{
	Vector2<double> a, b, c, p;
	while(cin >> a >> b >> c >> p)
	{
		if
		(
			(relation(b-a, b-p) > 0 && relation(c-b, b-p) > 0 && relation(a-c, a-p) > 0) &&
			(relation(b-a, b-p) <= 0 && relation(c-b, b-p) <= 0 && relation(a-c, a-p) <= 0) 
		)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}