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 <fstream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

int main() {
  ifstream cin("../test.txt");
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    bool res = false;
    // 平行移動
    x2 -= x1;
    x3 -= x1;
    xp -= x1;
    y2 -= y1;
    y3 -= y1;
    yp -= y1;
    // 傾き
    if (((y3 * xp > yp * x3) && (yp * x2 > y2 * xp)) || ((y2 * xp > yp * x2) && (yp * x3 > y3 * xp)))
      res = true;

    if (!res) {
      cout << "NO" << endl;
      continue;
    }

    // cout << "ok" << endl;
    // 直線BCの下にある
    // y - y1 = (y2 - y1)/(x2 - x1) (x - x1)
    if ( ((y3 - y2) * (xp - x2) - (x3 - x2) * (yp - y2)) * ((y3 - y2) * (0 - x2) - (x3 - x2) * (0 - y2)) < 0 )
      res = false;

    if (res) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }

}

C++: #include <iostream>
#include <complex>
#include <vector>
#include <cstdio>
using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;

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

double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

int main() {
  double x1,y1,x2,y2,x3,y3, x, y;
  while(cin >> x1) {
    cin >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y;
    P a1(x1,y1), a2(x2,y2), a3(x3,y3), a(x,y);

    if (ccw(a1,a2,a)==1 && ccw(a2,a3,a)==1 && ccw(a3, a1, a)==1
      || ccw(a1,a2,a)==-1 && ccw(a2,a3,a)==-1 && ccw(a3, a1, a)==-1)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
}

C++: #include <iostream>
using namespace std;

typedef struct {
	double x;
	double y;
}vector;

bool ex_product(double x0,double y0,double x1,double y1,double xp,double yp ){
	vector a={x1-x0,y1-y0};
	vector b={xp-x0,yp-y0};

	return (a.x*b.y-a.y*b.x)>=0;
}

int main(int argc, char *argv[]){
    
	double x1,y1,x2,y2,x3,y3,xp,yp;
	cin >> x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp;
	
	bool a=ex_product(x1,y1,x2,y2,xp,yp); 
	bool b= ex_product(x2,y2,x3,y3,xp,yp) ;
	bool c=ex_product(x3,y3,x1,y1,xp,yp) ;
	
	if((a && b && c) || ((!a) && (!b) && (!c)))cout <<"YES"<<endl;
	else cout <<"NO"<<endl;
					 
	
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define PI (acos(-1.0))
#define POSARG(a) (arg((a)) > 0.0? arg((a)) : 2.0*PI + arg((a)))
#define FOR(i,b,n) for(int i=b;i<n;i++)
#define RFOR(i,b,n) for(int i=n-1;i>=b;i--)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))

using namespace std;

static const double EPS = 1e-9;
typedef long long ll;
typedef pair<int, int> paii;
typedef complex<double> P;

double ccw(P& p1, P& p2, P& p3)
{
	return ((p2.real() - p1.real())*(p3.imag() - p1.imag()) 
				- (p2.imag() - p1.imag())*(p3.real() - p1.real())) > 0;
}// ccw>0 ...ccw, ccw=0 ...colinear, ccw<0 ...cw

int main()
{
	double x, y;
	P p1, p2, p3, px;
	
	cin >> x >> y;
	p1 = P(x, y);
	cin >> x >> y;
	p2 = P(x, y);
	cin >> x >> y;
	p3 = P(x, y);
	cin >> x >> y;
	px = P(x, y);
	
	if( ccw(p1, p2, px) > 0 && ccw(p2, p3, px) > 0 && ccw(p3, p1, px) > 0)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	
	return 0;
}