Go: package main

import (
        "fmt"
)

func main() {
        var x1, y1, x2, y2, x3, y3, px, py float64
        var oax, oay, obx, oby, opx, opy float64
        var det float64
        var s, t float64

        for {
                _, err := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py)
                if err != nil {
                        break
                }
                oax = x2 - x1
                oay = y2 - y1
                obx = x3 - x1
                oby = y3 - y1
                opx = px - x1
                opy = py - y1
                det = oax*oby - obx*oay

                if det == 0 {
                        fmt.Printf("NO\n")
                } else {
                        s = (oby*opx - obx*opy) / det
                        t = (oax*opy - oay*opx) / det

                        if (s+t < 1 && s > 0 && t > 0) {
                                fmt.Printf("YES\n")
                        } else {
                                fmt.Printf("NO\n")
                        }
                }
        }
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<cmath>
#include<complex>
using namespace std;

bool isin(double a, double b, double c){
	if(a>b) swap(a,b);
	if(b-a<M_PI){
		return (a<c && c<b);
	}
	else{
		return (b<c || c<a);
	}
}

int main(void){

	while(true){



	complex<double> p[4];
	double a, b, c, d, e, f, g, h;
	cin >> a >> b >> c >> d >> e >> f >> g >> h;
	p[0] = complex<double>(a,b);
	p[1] = complex<double>(c,d);
	p[2] = complex<double>(e,f);
	p[3] = complex<double>(g,h);

	double arg1, arg2, arg3;
	arg1 = arg(p[1]-p[0]);
	arg2 = arg(p[2]-p[0]);
	arg3 = arg(p[3]-p[0]);

	if(arg1<0) arg1+=2*M_PI;
	if(arg2<0) arg2+=2*M_PI;
	if(arg3<0) arg3+=2*M_PI;

	bool b0;
	b0 = isin(arg1, arg2, arg3);

	/////////////////////////

	arg1 = arg(p[0]-p[1]);
	arg2 = arg(p[2]-p[1]);
	arg3 = arg(p[3]-p[1]);

	if(arg1<0) arg1+=2*M_PI;
	if(arg2<0) arg2+=2*M_PI;
	if(arg3<0) arg3+=2*M_PI;

	bool b1;
	b1 = isin(arg1, arg2, arg3);

	/////////////////////////

	arg1 = arg(p[0]-p[2]);
	arg2 = arg(p[1]-p[2]);
	arg3 = arg(p[3]-p[2]);

	if(arg1<0) arg1+=2*M_PI;
	if(arg2<0) arg2+=2*M_PI;
	if(arg3<0) arg3+=2*M_PI;

	bool b2;
	b2 = isin(arg1, arg2, arg3);

	/////////////////////////

	if( b0 && b1 && b2 ) cout << "YES" << endl;
	else cout << "NO" << endl;

	if(cin>>a) break;

	}

	return 0;
}

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

// ?????§?¨?????????¨??????
typedef complex<double> P;
// ???????????
#define PI 3.1415926535898

// ?¨±?????????????????
#define EPS (1e-10)
//XY??§?¨?
#define X real()
#define Y imag()

//?????????double????????°???????????????????????????
bool equal(double a, double b){
	return ( abs( a-b ) < EPS )? true : false ;
}
	
// ????§???¢?????????
class Triangle{

private:
	//????§???¢??????????????§?¨?
	P a, b, c;
	//????§???¢??????????????????
	double edgeA,edgeB,edgeC;
	//????§???¢???????§??????§??????(????????¢???)
	double angleA,angleB,angleC;
	//????????????????????????????§????????±?????????¢??°
	double LawOfCosines(double a,double b, double c){
		return acos( (b*b+c*c-a*a) / (2.0*b*c) );
	}
	
public:
	//?????????????????????(??????????????¨?????¨?§????????????????)
	Triangle(P p1, P p2, P p3){
		a = p1;
		b = p2;
		c = p3;
		edgeB = abs(c-a);
		edgeA = abs(b-c);
		edgeC = abs(a-b);
		angleA = LawOfCosines(edgeA,edgeB,edgeC);
		angleB = LawOfCosines(edgeB,edgeC,edgeA);
		angleC = LawOfCosines(edgeC,edgeA,edgeB);
	}
	double getAngleC(){//?§?C????§????????????????
		return angleC;
	}
};

int main(){
	double x1, x2, x3, y1, y2, y3, xp, yp, angle;

	while( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp ){
		P a( x1 , y1 );
		P b( x2 , y2 );
		P c( x3 , y3 );
		P p( xp , yp );
		Triangle Tr1(a,b,p);
		Triangle Tr2(b,c,p);
		Triangle Tr3(c,a,p);
		angle = Tr1.getAngleC() + Tr2.getAngleC() + Tr3.getAngleC();
		( equal( 2.0*PI , angle) )? cout << "YES" : cout << "NO" ;
		cout << endl;
	}
}

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

typedef complex<double> P;

double cross(P a, P b) {
  return a.real()*b.imag() - a.imag()*b.real();
}

vector<P> ps(3);
P p;

bool isIn() {
  for(int i = 0; i < ps.size(); ++i) {
    P q = ps[i];
    P r = ps[(i+1)%ps.size()];
    if(cross(r-q, p-q) < 0.0) return false;
  }
  return true;
}

int main() {
  while(cin >> ps[0].real() >> ps[0].imag()) {
    for(int i = 1; i < ps.size(); ++i) {
      cin >> ps[i].real() >> ps[i].imag();
    }
    cin >> p.real() >> p.imag();
    bool flag = false;
    if(isIn() || ( swap(ps[0], ps[1]), isIn() )) {
      cout << "YES" << endl;    
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}

C++: //ツ三ツ角ツ形ABCツづ個陳?づ可点Pツつェツ甘慊づ慊づェツづゥツつゥツづ?つ、ツつゥツづ個板サツ津ィツづ個仕ツ陛サ
//ツ「ツ三ツ角ツ形ABP, BCP, CAPツづ個姪環静渉づ個債?計 == ツ三ツ角ツ形ABCツづ個姪環静渉」
//ツづ可づ按づ?づ?つ「ツづェツづ? ツ点Pツづ債三ツ角ツ形ツづ可甘慊づ慊づェツづゥ

#include <iostream>
#include <complex>
#include <cstdlib>
#include <cmath>
using namespace std;

typedef complex<double> P;

#define EPS (1e-8)

P t[3], p;

//3ツづつづ個点ツづ個湘ョツ陛アツつゥツづァ, ツ三ツ角ツ形ツづ個姪環静渉づーツ仰?づ淞づゥ
//ツヘツδ債δ督づ個古カツ篠ョツづーツ用ツつ「ツづゥ
double getArea(const P &a, const P &b, const P &c){
  double A = abs(a - b);
  double B = abs(b - c);
  double C = abs(c - a);
  double S = (A + B + C) / 2.0;

  return sqrt(S * (S - A) * (S - B) * (S - C));
}

void solve(){
  double sum = 0;

  //ABP, BCP, CAPツづ個三ツ角ツ形ツづ個姪環静渉づーツ仰?づ淞づ? ツ堕ォツつオツ債?づュツつケツづゥ
  for(int i = 0; i < 3; i++){
    sum += getArea(t[i], t[(i + 1) % 3], p);
  }

  //ツ三ツ角ツ形ABCツづ個姪環静渉づーツ仰?づ淞づゥ
  double abc = getArea(t[0], t[1], t[2]);

  //sumツづ?bcツづ個債キツつェ, ツ古?づィツづ按つュ0ツづ可凝淞つ「ツづ按づァツ督卍つオツつ「ツづ個づ? YES
  if(fabs(sum - abc) < EPS){
    cout << "YES\n";
  }
  else{
    cout << "NO\n";
  }
}

int main(){
  while(true){
    for(int i = 0; i < 3; i++){
      if(!(cin >> t[i].real() >> t[i].imag())) return 0;
    }
    cin >> p.real() >> p.imag();
    solve();
  }
}

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

double round(double d) {
    if (d < 0) {
        d *= 1000;
        d -= 0.5;
        int i = d;
        d = i / 1000.0;
    } else {
        d *= 1000;
        d += 0.5;
        int i = d;
        d = i / 1000.0;
    }

    return d;
}

double length(double, double, double, double);

double radian(double x1, double y1, double x2, double y2, double x3, double y3) {
    double a = length(x1, y1, x3, y3);
    double b = length(x2, y2, x3, y3);
    double c = length(x1, y1, x2, y2);

    double d = (a + b - c) / sqrt(a * b) / 2.0; // cos(radian)
    double r = acos(d);

    return r;
}

double length(double x, double y, double ox, double oy) {
    return pow(x - ox, 2) + pow(y - oy, 2);
}

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

    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        double ta = radian(x1, y1, x2, y2, xp, yp);
        double tb = radian(x1, y1, x3, y3, xp, yp);
        double tc = radian(x2, y2, x3, y3, xp, yp);

        if (round(ta + tb + tc) == round(2 * M_PI)) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }

        if (cin.eof()) break;
    }

    return 0;
}