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 <cmath>

using namespace std;

double compute( double x[], double y[] ){

  double result = 0;
  for( int j = 1 ; j <= 3 ; j++ ){
    int J = j + 1;
    if( j == 3 ) J = 1;
    result += ( x[j]*y[J] - x[J]*y[j] );
  }
  result = abs(result) / 2;
  return result;
}

double heron(double a,double b,double c){
  double s = (a + b + c) / 2;
  double S = sqrt(s*(s - a)*(s - b)*(s - c) ); //テ」ツδ佚」ツδュテ」ツδウテ」ツ?ョテ・ツ?ャテ・ツシツ湘」ツつ津、ツスツソテァツ板ィ
  return S;
}

int main(void){

  double x[5];
  double y[5];

  while( cin >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3] >> x[4] >> y[4] ){

    double area1 = compute(x,y);
 
    double a = sqrt( pow( x[1] - x[2], 2 ) + pow( y[1] - y[2], 2 ) );
    double b = sqrt( pow( x[1] - x[3], 2 ) + pow( y[1] - y[3], 2 ) );
    double c = sqrt( pow( x[3] - x[2], 2 ) + pow( y[3] - y[2], 2 ) );
    double d = sqrt( pow( x[1] - x[4], 2 ) + pow( y[1] - y[4], 2 ) );
    double e = sqrt( pow( x[2] - x[4], 2 ) + pow( y[2] - y[4], 2 ) );
    double f = sqrt( pow( x[3] - x[4], 2 ) + pow( y[3] - y[4], 2 ) );
    double area2 = heron(d,e,a) + heron(d,f,b) + heron(e,f,c);

    if( (float)area1 == (float)area2) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const double EPS = 1e-12;
const double INF = 1e12;

typedef complex<double> P;
typedef vector< complex<double> >polygon;
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);
}


int contains(const polygon& poly, const P & p) {
	bool in = false;
	for (int i = 0; i < SZ(poly); ++i) {
		P a = poly[i] - p, b = poly[(i+1)%SZ(poly)] - p;
		if (imag(a) > imag(b)) swap(a, b);
		if (imag(a) <= 0 && 0 < imag(b))
	  		if (cross(a, b) < 0) in = !in;
		if (cross(a, b) == 0 && dot(a, b) <= 0) return 1;
	}
	return in ? 2 : 0;
}


int main(){
	
	vector<string>res;
	polygon tri(3);
	P p;
	while(cin>>tri[0].real()>>tri[0].imag()>>tri[1].real()>>tri[1].imag()>>tri[2].real()>>tri[2].imag()>>p.real()>>p.imag()){
		if(contains(tri,p)==2)res.PB("YES");
		else res.PB("NO");
	}
	REP(i,SZ(res))cout<<res[i]<<endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <deque>

using namespace std;

int main()
{
	double x1,y1,x2,y2,x3,y3,xp,yp;
	deque<double> nums;
	
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
	{
		nums.push_back(x1);
		nums.push_back(x2);
		nums.push_back(x3);
		sort( nums.begin(), nums.end());
		
		deque<double>::iterator it = nums.begin();
		double a,b,c,d;

		a = *it;
		it += 2;
		b = *it;

		nums.clear();

		nums.push_back(y1);
		nums.push_back(y2);
		nums.push_back(y3);
		sort( nums.begin(), nums.end());
		
		it = nums.begin();
		c = *it;
		it += 2;
		d = *it;

		int ture=0;
		
		if(xp<a) ;
		else if(b<xp);
		else ture++;

		if(yp<c) ;
		else if(d<yp);
		else ture++;

		if(ture==2) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;

		nums.clear();

	}

	return 0;
}