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 <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

double cross(double x1,double y1,double x2,double y2)
{
	return x1*y2-x2*y1;
}

int ccw(double x1,double y1,double x2,double y2,double x3,double y3)
{
	//dump(cross(x2-x1,y2-y1,x3-x1,y3-y1));
	return cross(x2-x1,y2-y1,x3-x1,y3-y1)+1e-6>0;
}

int main()
{
	for(string s;getline(cin,s);){
		istringstream iss(s);
		vector<double> x(3),y(3);
		rep(i,3)
			iss>>x[i]>>y[i];
		double xp,yp;
		iss>>xp>>yp;
		
		if(!ccw(x[0],y[0],x[1],y[1],x[2],y[2])){
			swap(x[1],x[2]);
			swap(y[1],y[2]);
		}
		
		bool in_triangle=true;
		rep(i,3){
			//printf("(%.3f,%.3f)  (%.3f,%.3f) (%.3f,%.3f)\n",x[0],y[0],x[1],y[1],x[2],y[2]);
			
			if(!ccw(x[0],y[0],x[1],y[1],xp,yp))
				in_triangle=false;
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}
		
		cout<<(in_triangle?"YES":"NO")<<endl;
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


constexpr double eps = 1e-10;
int sgn(double a) { return a < -eps ? -1 : a > eps; }
using P = complex<double>;
namespace std {
  istream& operator>>(istream& i, P& p) { double x, y; i >> x >> y; p = P(x, y); return i; }
  ostream& operator<<(ostream& o, const P& p) { return o << real(p) << ' ' << imag(p); }
}
double dot(const P& p, const P& q) { return real(conj(p) * q); }
double cross(const P& p, const P& q) { return imag(conj(p) * q); }

int ccw(P p0, P p1, P p2) {
  p1 -= p0, p2 -= p0;                         //             (1)
  if (sgn(cross(p1, p2)) > 0) return 1;       //
  if (sgn(cross(p1, p2)) < 0) return -1;      // (-2)---p0---(0)---p1---(2)
  if (sgn(dot(p1, p2) < 0)) return -2;        //
  if (sgn(norm(p1) - norm(p2)) < 0) return 2; //             (-1)
  return 0;
}

V<string> split(const string& s, char c) {
  V<string> res;
  stringstream ss(s);
  string t;
  while (getline(ss, t, c)) res.push_back(t);
  return res;
}

int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  string s;
  while (getline(cin, s)) {
    auto ss = split(s, ' ');
    V<P> p(3);
    for (int i = 0; i < 3; ++i) {
      p[i] = {stod(ss[2 * i]), stod(ss[2 * i + 1])};
    }
    P q = {stod(ss[6]), stod(ss[7])};
    bool in = true;
    for (int i = 0; i < 3; ++i) {
      if (ccw(p[i], p[(i + 1) % 3], p[(i + 2) % 3]) != ccw(p[i], p[(i + 1) % 3], q)) {
        in = false;
        break;
      }
    }
    cout << (in ? "YES" : "NO") << '\n';
  }
}

C++: #include <iostream>

using namespace std;

class Vector3{
public:
	double x,y;

	Vector3(){}
	Vector3( double dx, double dy ){
		x = dx;
		y = dy;
	}

	double operator*( Vector3 hoge ){
		return ( x * hoge.y - ( y * hoge.x ) );
	}

	void operator-=( Vector3 hoge ){
		x -= hoge.x;
		y -= hoge.y;
	}
};

double crossProduct( Vector3 a, Vector3 b, Vector3 p )
{
	b -= a;
	p -= a;

	return b * p;
}

int main(int argc, char const* argv[])
{
	Vector3 p[3];
	Vector3 point;
	double answer[3];

	while( cin >> p[0].x >> p[0].y >> p[1].x >> p[1].y >> p[2].x >> p[2].y >> point.x >> point.y ){
		answer[0] = crossProduct( p[0], p[1], point );
		answer[1] = crossProduct( p[1], p[2], point );
		answer[2] = crossProduct( p[2], p[0], point );
		if( ( ( answer[0] < 0 ) && (answer[1] < 0 ) && ( answer[2] < 0 ) ) || ( ( answer[0] > 0 ) && ( answer[1] > 0 ) && ( answer[2] > 0 ) ) )
			cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}