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 <complex>
#include <cstdio>
using namespace std;

const double EPS = 1e-8;
const double INF = 1e12;
typedef complex<double> P;
namespace std{
	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);
}
bool in_triangle(const P& p1,const P& p2,const P& p3,const P& p){
	return cross(p2-p1,p-p1)>0 && cross(p3-p2,p-p2)>0 && cross(p1-p3,p-p3)>0;
}
int main(){
	double x1,y1,x2,y2,x3,y3,x,y;
	for(;~scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x,&y);){
		P p1(x1,y1),p2(x2,y2),p3(x3,y3),p(x,y);
		bool in=in_triangle(p1,p2,p3,p)||in_triangle(p2,p1,p3,p);
		puts(in?"YES":"NO");
	}
}

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;
}