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 <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;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define Eps (1e-10)

int main() {
  double x[4], y[4];
  while (cin >> x[0] >> y[0]) {
    for (int i = 1; i < 4; ++i) cin >> x[i] >> y[i];
    double S, subS;
    S = fabs((x[0]*y[1] + x[1]*y[2] + x[2]*y[0]
              - y[0]*x[1] - y[1]*x[2] - y[2]*x[0]) / 2);
    
    subS = fabs((x[0]*y[1] + x[1]*y[3] + x[3]*y[0]
              - y[0]*x[1] - y[1]*x[3] - y[3]*x[0]) / 2);
    subS += fabs((x[0]*y[3] + x[3]*y[2] + x[2]*y[0]
              - y[0]*x[3] - y[3]*x[2] - y[2]*x[0]) / 2);
    subS += fabs((x[3]*y[1] + x[1]*y[2] + x[2]*y[3]
              - y[3]*x[1] - y[1]*x[2] - y[2]*x[3]) / 2);
    printf("%s\n", (fabs(S-subS) < Eps) ? "YES" : "NO");
  }
 
  return 0;
}

C++: #include <iostream>
#include <string>
#include <cmath>
using namespace std;
const string mes[2] = {"YES", "NO"};
double dist(double a, double b) {
  return sqrt(a*a + b*b);
}

int main (int argc, char const* argv[]) {
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while (cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp) {
    double cx = (x1 + x2 + x3) / 3.0;
    double cy = (y1 + y2 + y3) / 3.0;
    double cdist = dist(cx-x1,cy-y1) + dist(cx-x2,cy-y2) + dist(cx-x3,cy-y3);
    //double cdist = dist(x1-x2,y1-y2) + dist(x1-x3,y1-y3);
    double pdist = dist(xp-x1,yp-y1) + dist(xp-x3,yp-y2) + dist(xp-x3,yp-y3);
    int res = (cdist > pdist)?0:1;
    cout<<mes[res]<<endl;
  }
  
  return 0;
}