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 <cmath>

using namespace std;

double square(double, double, double, double, double, double);

int main() {

	double x1, y1, x2, y2, x3, y3, xp, yp, S123, SP12, SP23, SP31;

	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		S123=square(x1, y1, x2, y2, x3, y3);
		SP12=square(xp, yp, x1, y1, x2, y2);
		SP23=square(xp, yp, x2, y2, x3, y3);
		SP31=square(xp, yp, x3, y3, x1, y1);

		if(S123==SP12+SP23+SP31)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;

}

double square(double x1, double y1, double x2, double y2, double x3, double y3) {

	double a, b, c, d;

	a=x2-x1;
	b=y2-y1;
	c=x3-x1;
	d=y3-y1;

	return abs(a*d-c*b)/2;

}

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

int main()
{
	double x1,y1,x2,y2,x3,y3,xp,yp;
	char a[40],b[40],c[40],d[40];
	while (scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)==8)
	{
		sprintf(a,"%.3lf",fabs(x1*(y2-y3)-x2*(y1-y3)+x3*(y1-y2)));
		sprintf(b,"%.3lf",fabs(x1*(y2-yp)-x2*(y1-yp)+xp*(y1-y2)));
		sprintf(c,"%.3lf",fabs(x1*(yp-y3)-xp*(y1-y3)+x3*(y1-yp)));
		sprintf(d,"%.3lf",fabs(xp*(y2-y3)-x2*(yp-y3)+x3*(yp-y2)));
		sscanf(a,"%lf",&xp);
		sscanf(b,"%lf",&x1);
		sscanf(c,"%lf",&x2);
		sscanf(d,"%lf",&x3);
		if (xp==x1+x2+x3)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<iostream>
#include<complex>
#include<vector>
#include<cmath>
#include<algorithm>
#include<cstdio>

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 complex<D> P;
typedef pair<P, P> L;
typedef vector<P> Pol;

const D INF = 1e40;
const D EPS = 1e-8;
const D PI = acos(-1);

int sig(D r) {return (r < -EPS) ? -1 : (r > EPS) ? 1: 0;}
bool eq(D a, D b) {return abs(a - b) < EPS;}
bool near(P a, P b) {return abs(b - a) < EPS;}

// 内積
D dot(P a, P b) {return a.X * b.X + a.Y * b.Y;}
// 外積
D cross(P a, P b) {return a.X * b.Y - a.Y * b.X;}

// 線分のベクトル
P vec(L a) {return a.second - a.first;}

// 線分abに対する点xの位置
enum CCW{FRONT = 1, RIGHT = 2, BACK = 4, LEFT = 8, ON = 16};
int ccw(L s, P p) {
  P a = vec(s);
  p -= s.first;
  D cr = cross(a, p);
  if (eq(cr, 0)) {
    if (sig(dot(a, p)) < 0) return BACK;
    if (sig(norm(a) - norm(p)) < 0) return FRONT;
    return ON;
  }
  return (cr > 0) ? LEFT : RIGHT;
}

int main() {
  P a, b, c, p;
  while (cin >> a.X >> a.Y >> b.X >> b.Y >> c.X >> c.Y >> p.X >> p.Y) {
    int bit = ccw(L(a, b), p) | ccw(L(b, c), p) | ccw(L(c, a), p);
    if (bit == LEFT || bit == RIGHT) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}