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;

int main(void) {
	double x[3] = { 0,0,0 };
	double y[3] = { 0,0,0 };
	double xp = 0, yp = 0;
	int flag[3] = { 0,0,0 };

	while (cin >> x[0]>> y[0]>> x[1]>> y[1]>> x[2]>> y[2]>> xp>> yp) {
		for (int i = 0; i < 3; i++) {
			int temp1 = (i + 1) % 3;
			int temp2 = (i + 2) % 3;
			double checkI = (y[temp1] - y[i]) * (x[temp2] - x[i]) + (x[temp1] - x[i]) * (y[temp2] - y[i]);
			double checkP = (y[temp1] - y[i]) * (xp - x[i]) + (x[temp1] - x[i]) * (yp - y[i]);

			if (checkI * checkP > 0) {
				flag[i] = 1;
			}
		}
		if (flag[0] == 1 && flag[1] == 1 && flag[2] == 1) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
		flag[0] = 0;
		flag[1] = 0;
		flag[2] = 0;
	}
	

	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) > 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;
		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 <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.pt", "r", stdin);
	string str = "";

	while (getline (cin, str )){
		int i;
		vector <double> tpx (3, 0.);
		vector <double> tpy (3, 0.);
		double px = 0.;
		double py = 0.;
	
		stringstream ss(str);

		for (i = 0; i < 3; ++i){
			double tx,ty;
			ss >> tx >> ty;
			tpx[i] = tx; tpy[i] = ty;
		} // end for
		ss >> px >> py;

		vector <double> a(3, 0.);
		vector <double> b(3, 0.);
		vector <double> c(3, 0.);
/*
		for (i = 0; i < 3; ++i){
			cout << "tp[" << i << "]: ";
			cout << '(' << tpx[i] << ',' << tpy[i] << ')' << endl;
		} // end for
		cout << "p: ";
		cout << '(' << px << ',' << py << ')' << endl;
*/
		int j;
		for (i = 0; i < 3; ++i){
			j = (i + 1) % 3;
			if (tpx[i] == tpx[j]){
				a[i] = 1.0;
				b[i] = 0.0;
				c[i] = -a[i]*tpx[i] - b[i]*tpy[i];
			}else if (tpy[i] == tpy[j]){
				a[i] = 0.0;
				b[i] = 1.0;
				c[i] = -a[i]*tpx[i] - b[i]*tpy[i];
			}else{
				a[i] = (tpy[j] - tpy[i]);
				b[i] = -(tpx[j] - tpx[i]);
 				c[i] = -a[i]*tpx[i] - b[i]*tpy[i];
			} // end if
//			cout << a[i] << ' ' << b[i] << ' ' << c[i] << endl;
		} // end for
		vector <int> d(3, 0.0);

		for (i = 0; i < 3; ++i){
			if (a[i] != 0.0 && b[i] != 0.0){
				if ( py > (-a[i]*px - c[i])/b[i] ){
					d[i] = 1;
				}else if ( py < (-a[i]*px - c[i])/b[i] ){
					d[i] = -1;
				} // end if
			}else if (a[i] == 0.0 && b[i] != 0.0){
				if ( py > - c[i]/b[i] ){
					d[i] = 1;
				}else if ( py < -c[i]/b[i] ){
					d[i] = -1;
				} // end if
			}else if (a[i] != 0.0 && b[i] == 0.0){
				if ( px > -c[i]/a[i] ){
					d[i] = 1;
				}else if ( px < -c[i]/a[i] ){
					d[i] = -1;
				} // end if
			} // end if
//			cout << "d[" << i << "]: " << d[i] << endl;
		} // end for

		int plus = 0;
		int minus = 0;
		for (i = 0; i < 3; ++i){
			if (d[i] > 0){
				++plus;
			}else{
				++minus;
			} // end if
		} // end for

		if (plus == 1 && minus == 2){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		} // end if
			
	} // end for
		
	return 0;
}

C++: #include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>

using namespace std;

double EPS = 1e-10;

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

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

double dot(point a, point b) {
  return (a.x * b.x + a.y * b.y);
}

double cross(point a, point b) {
  return (a.x * b.y - a.y * b.x);
}

int is_point_on_line(point a, point b, point c) {
  return cross(b-a, c-a)==0.0 &&
         (dot(b-a, c-a) > -EPS) &&
         (dot(a-b, c-b) > -EPS);
}

int is_intersected_ls(point a1, point a2, point b1, point b2) {

  if(cross(a1-a2,b1-b2)==0){
    return is_point_on_line(a1,a2,b1) || is_point_on_line(a1,a2,b2) 
        || is_point_on_line(b1,b2,a1) || is_point_on_line(b1,b2,a2);
  }
  else {
    return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
           ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
  }
}

int inside(point p, vector<point> ps){
  point a,b;
  a=b=p;

  b.x=1000000;

  int n=ps.size();
  ps.push_back(ps[0]);

  if(a.y<=ymn||a.y>=ymx)return 0;
  
  for(int i=0;i<n;i++){
    if(is_point_on_line(ps[i],ps[i+1],p))return 0;
  }
  
  int cnt1=0;
  for(int i=0;i<n;i++)
    if(is_point_on_line(a,b,ps[i]))cnt1++;
  
  int cnt=0;
  for(int i=0;i<n;i++)
    if(is_intersected_ls(ps[i],ps[i+1],a,b))cnt++;
  
  return (cnt-cnt1)%2;
}

int main(void){
 
  point in[4],p;
  vector<point>ps;

  while(cin>>in[1].x>>in[1].y>>in[2].x>>in[2].y>>in[3].x>>in[3].y>>p.x>>p.y){

    ps.clear();

    for(int i=1;i<4;i++)
    ps.push_back(in[i]);

    if(inside(p,ps))cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}