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>
using namespace std;

struct TPoint
{
	double x;
	double y;
};

double GetCrossProduct(const TPoint& V1, const TPoint& V2)
{
	return V1.x * V2.y - V1.y * V2.x;
}

TPoint Vector(const TPoint& P1, const TPoint& P2)
{
	return {P2.x - P1.x, P2.y - P1.y};
}

bool IsSameSide(const TPoint& P1, const TPoint& P2, const TPoint& L1, const TPoint& L2)
{
	return GetCrossProduct(Vector(L1, P1), Vector(L1, L2)) * GetCrossProduct(Vector(L1, P2), Vector(L1, L2)) > 0;
}

int main()
{
	while(true){
		TPoint A1, A2, A3, Ap;
		cin >> A1.x >> A1.y >> A2.x >> A2.y >> A3.x >> A3.y >> Ap.x >> Ap.y;
		if(cin.eof() == true) break;
		if(IsSameSide(A3, Ap, A1, A2) && IsSameSide(A1, Ap, A2, A3) && IsSameSide(A2, Ap, A3, A1)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
 
int main() {
double x1, y1, x2, y2, x3, y3, xp ,yp,ss,s1,s2,s3;
while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
ss=fabs((x3-x1)*(y2-y1)-(x2-x1)*(y3-y1));
s1=fabs((x3-xp)*(y2-yp)-(x2-xp)*(y3-yp));
s2=fabs((x3-xp)*(y1-yp)-(x1-xp)*(y3-yp));
s3=fabs((x2-xp)*(y1-yp)-(x1-xp)*(y2-yp));
 
if(fabs(s1+s2+s3-ss)<0.001){
    cout<<"YES"<<endl;
}
else{
    cout<<"NO"<<endl;
}}
    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <math.h>

using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)

bool judge(double x[3], double y[3]) {
	double rad1 = atan2(y[0], x[0]);
	double rad2 = atan2(y[1], x[1]);
	double rad3 = atan2(y[2], x[2]);
	if(rad3 < rad1 && rad2 < rad3 || rad1 < rad3 && rad3 < rad2) return true;
	else return false;
}

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
		double x[3], y[3];
		x[0] = x2 - x1;
		y[0] = y2 - y1; 
		x[1] = x3 - x1;
		y[1] = y3 - y1;
		x[2] = xp - x1;
		y[2] = yp - y1;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			break;
		}
		x[0] = x1 - x2;
		y[0] = y1 - y2;
		x[1] = x3 - x2;
		y[1] = y3 - y2;
		x[2] = xp - x2;
		y[2] = yp - y2;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			break;
		}
		x[0] = x1 - x3;
		y[0] = y1 - y3;
		x[1] = x2 - x3;
		y[1] = y2 - y3;
		x[2] = xp - x3;
		y[2] = yp - y3;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			break;
		}
		cout << "YES" << endl;
	}
	return 0;
}

C++: #include <iostream>


#define EPSILON 1e-9


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

public:
  vector_t(double x = 0, double y = 0, double z = 0) : x(x), y(y), z(z) {};

public:
  vector_t operator^(const vector_t& v) const {
    return vector_t(y * v.z - z * v.y,
                    z * v.x - x * v.z,
                    x * v.y - y * v.x);
  };
};


class point_t {
public:
  double x;
  double y;
  double z;
  double w;

public:
  point_t(double x = 0, double y = 0, double z = 0, double w = 1) : x(x), y(y), z(z), w(w) {};
  
public:
  vector_t operator-(const point_t& p) const {
    return vector_t(x - p.x, y - p.y, z - p.z);
  };
};


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

  while (std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    point_t p1(x1, y1);
    point_t p2(x2, y2);
    point_t p3(x3, y3);
    point_t p (xp, yp);

    if (((p2 - p1) ^ (p - p1)).z > -EPSILON &&
        ((p3 - p2) ^ (p - p2)).z > -EPSILON &&
        ((p1 - p3) ^ (p - p3)).z > -EPSILON) {

      std::cout << "YES" << std::endl;
    }
    else {
      std::cout << "NO" << std::endl;
    }
  }
}

C++: #include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <cmath>
#define INF 100000000
using namespace std;
typedef double d;
bool isintersect(d x1,d x2, d y1 , d y2 , d px, d py , d qx, d qy)
{
  return ((py-y1)*(x1-x2) + (px - x1)*(y1-y2))*((qy-y1)*(x1-x2) + (qx - x1)*(y1-y2)) >= 0;
}
int main(){
  double x1,y1,x2,y2,x3,y3,xp,yp;
  while( cin >>  x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp )
    {
      if( isintersect(x1,x2,y1,y2,xp,yp,x3,y3) &&
	  isintersect(x1,x3,y1,y3,xp,yp,x2,y2) &&
	  isintersect(x3,x2,y3,y2,xp,yp,x1,y1))cout << "YES" << endl;
      else cout << "NO" << endl;
    }
  return 0;
}