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 <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <iterator>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) container.begin(), container.end()
#define RALL(container) container.rbegin(), container.rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

const int INF = 1<<28;
const double EPS = 1e-10;
const int MOD = 1000000007;

#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> G;
struct L : public vector<P>{
	L(P p1, P p2){this->push_back(p1);this->push_back(p2);}
};
istream& operator>>(istream &is, P &p) {
	double x, y;
	is >> x >> y;
	p = P(x, y);
	return is;
}
inline int sig(double x) { return (abs(x) < EPS ? 0 : x > 0 ? 1 : -1); }
inline double norm(const P &p){return p.X*p.X+p.Y*p.Y;}
inline double inp(const P& a, const P& b){return (conj(a)*b).X;}
inline double outp(const P& a, const P& b){return (conj(a)*b).Y;}
inline bool sp_intersect(const L &s, const P &p){return !sig(norm(s[0]-p) + norm(s[1] - p) - norm(s[0] - s[1]));}

bool gp_contains(const G &g, const P &p){
	int n = g.size();
	double sum = .0;
	REP(i, n){
		if(sp_intersect(L(g[i], g[(i+1)%n]), p)) return false;	// online
		sum += arg((g[i] - p) / (g[(i+1)%n] - p));
	}
	return sig(sum);
}

int n;

int main(){
	ios::sync_with_stdio(false);
	while(1){
		G g;
		P p;
		REP(i, 3){
			if(!(cin >> p)) return 0;
			g.push_back(p);
		}
		cin >> p;
		puts(gp_contains(g, p) ? "YES" : "NO");
	}
	return 0;
}

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

double x[4],y[4];
string judge ();

int main() {
	while ( cin >> x[0] ) {
		for( int i = 0; i < 4; i++ ){
			if ( !i )
				cin >> y[i];
			else
				cin >> x[i] >> y[i];
		}
		
		cout <<  judge () << endl;
		
	}
	return 0;
}

string judge () {
	string res;
	double a,b;
	int n,nn;
	
	for ( int i = 0; i < 3; i++ ) {
		if ( i == 2 ){
			n = '0';
			nn = n + 1;
		}else if ( i == 1 ){
			n = i + 1;
			nn = '0';
		}else{
			n = i + 1;
			nn = n + 1;
		}
		
		a = (y[n] - y[i]) / (x[n] - x[i]);
		b = (x[i] * y[n] - x[n] * y[i]) / (x[i] - x[n]);
		
		if ( (a * x[3] + b) > y[3] && (a * x[nn] + b) < y[nn] || (a * x[3] + b) < y[3] && (a * x[nn] + b) > y[nn] ) {
			return "NO";
		}
	}
	return "YES";
	
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

struct pos{
	double x;
	double y;
};
int main() {
		vector<pos> point(4);
		REP(j,4){
			cin >> point[j].x >> point[j].y;
		}
		bool yes=true;
		REP(j, 3){
			double cross = (point[(j + 1) % 3].x - point[(j) % 3].x)*(point[3].x - point[(j) % 3].x) + (point[(j + 1) % 3].y - point[(j) % 3].y)*(point[3].y - point[(j) % 3].y);
			if (cross <= 0){
			yes=false;
			}
		}
		if (yes)
		cout << "YES"<<endl;
		else
		cout << "NO" << endl;
}

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

void couten(double x[], double y[], double &cx, double &cy){
	double a2, b2, c2, a, b, c, s, S2;
	a2 = abs((x[2]-x[1])*(x[2]-x[1]) + (y[2]-y[1])*(y[2]-y[1]));
    b2 = abs((x[0]-x[2])*(x[0]-x[2]) + (y[0]-y[2])*(y[0]-y[2]));
    c2 = abs((x[1]-x[0])*(x[1]-x[0]) + (y[1]-y[0])*(y[1]-y[0]));
    a = sqrt(a2); b = sqrt(b2); c = sqrt(c2);
    s = (a + b + c) / 2;
    S2 = s * (s-a) * (s-b) * (s-c);
	cx = (a2*(b2+c2-a2)*x[0] + b2*(c2+a2-b2)*x[1] + c2*(a2+b2-c2)*x[2]) / (16 * S2);
    cy = (a2*(b2+c2-a2)*y[0] + b2*(c2+a2-b2)*y[1] + c2*(a2+b2-c2)*y[2]) / (16 * S2);
}

int hantei(double x[], double y[], double &cx, double &cy, double xp, double yp){
	bool flag[3];
	double tc, tp, tcc, tpp;
	x[3] = x[0]; y[3] = y[0];
	for(int i = 0; i < 3; i++){
		tc = (x[i] - x[i + 1]) * (cy - y[i]) + (y[i] - y[i + 1]) * (x[i] - cx);
		tp = (x[i] - x[i + 1]) * (yp - y[i]) + (y[i] - y[i + 1]) * (x[i] - xp);
		if(tc * tp >= 0){
			flag[i] = true;
		} else{
			continue;
		}
	}
	if(flag[0] == true && flag[1] == true && flag[2] == true){
		return 1;
	} else{
		return 0;
	}
}


int main(){
	double x[3], y[3], xp, yp, cxx, cyy;
	double &cx = cxx, &cy = cyy;
	
	while(cin >>x[0] >>y[0] >>x[1] >>y[1] >>x[2] >>y[2] >>xp >>yp){
		couten(x, y, cx, cy);
		if(hantei(x, y, cx, cy, xp, yp)){
			cout <<"Yes"<<endl;
		} else{
			cout <<"No"<<endl;
		}
	}
	
	return 0;
}