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<stdio.h>
#include<math.h>

//マクロ定義
#define TRUE 1
#define FALSE 0

#define POINT1 0
#define POINT2 1
#define POINT3 2
#define TRIANGLE 3
#define AREA 4

#define compile 0

//関数のプロトタイプ宣言
int func_cal(double x[], double y[], double px, double py);
double func_cal_edge(double x[], double y[], double edge[]);
double func_cal_distance(double x, double y, double px, double py);
double func_cal_area(double edge[], double distance_toP[]);
double func_cal_areaT(double edge[], int n);
void func_output(int result);

main()
{
	double x[TRIANGLE], y[TRIANGLE];
	double px = 0, py = 0;
	int result = 0;
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x[POINT1], &y[POINT1], &x[POINT2], &y[POINT2], &x[POINT3], &y[POINT3], &px, &py) != EOF) //入力がEOFになるまで繰り返す
	{
		result = func_cal(x, y, px, py); //resultにfunc_calの結果を代入
#if compile == 1
		printf("result = %d\n", result);
#endif
		func_output(result);
	}
	return 0;
}

int func_cal(double x[], double y[], double px, double py)
{
	int i = 0, result = 0; //iはfor文制御用の変数
	double edge[TRIANGLE] = {0, 0, 0}; //0を点1点2の辺,1を点2点3の辺,2を点3点1の辺とする
	double area[AREA] = {0, 0, 0, 0};
	double distance_toP[TRIANGLE] = {0, 0, 0}; //与えられた3点と点pの距離を格納する
	/*
	area[0〜2]:点pを頂点に含む三角形3つの面積
	area[3]:与えられた3つの点を頂点とする三角形の面積
	--------------------------------------------------
	distance_toP[0]:点1から点pの距離
	distance_toP[1]:点2から点pの距離
	distance_toP[2]:点3から点pの距離
	*/
	
	func_cal_edge(x, y, edge); //辺の長さを計算する関数
	
	for(i = 0; i < TRIANGLE; i++)
	{
		distance_toP[i] = func_cal_distance(x[i], y[i], px, py);
	}
	for(i = 0; i < AREA; i++)
	{
		if(i < AREA - 1)
		{
			area[i] = func_cal_area(edge, distance_toP);
		}
		else
		{
			area[i] = func_cal_areaT(edge, TRIANGLE); //areaの3番目に与えられた3点を頂点とする三角形の面積を代入
			//printf("i = %d area[%d] = %lf\n", i, i, area[i]);
		}
	}
	//printf("area[%d] = %.15lf\n", TRIANGLE, area[TRIANGLE]);
	//printf("area sum = %.15lf\n", area[0] + area[1] + area[2]);
	if((area[TRIANGLE] - (area[0] + area[1] + area[2])) <= 0.00001)
	{
		result = TRUE;
		return result;
	}
	else
	{
		result = FALSE;
		return result;
	}
}

double func_cal_edge(double x[], double y[], double edge[]) //辺の長さを計算する関数
{
	edge[0] = sqrt(pow(x[POINT1] - x[POINT2], 2) + pow(y[POINT1] - y[POINT2], 2));
	edge[1] = sqrt(pow(x[POINT2] - x[POINT3], 2) + pow(y[POINT2] - y[POINT3], 2));
	edge[2] = sqrt(pow(x[POINT1] - x[POINT3], 2) + pow(y[POINT1] - y[POINT3], 2));
}

double func_cal_distance(double x, double y, double px, double py) //各点から点pへの距離を計算する関数
{
	double dis = 0;
	dis = sqrt(pow(px - x, 2) + pow(py - y, 2));
	return dis;
}

double func_cal_area(double edge[], double distance_toP[])
{
	static int si = 0, sj = 1; 
	double s = 0, result = 0;
	if((si == 2) && (sj == 3))
	{
		sj = 0;
		s = (edge[si] + distance_toP[si] + distance_toP[sj]) / 2;
		result = sqrt(s * (s - edge[si]) * (s - distance_toP[si]) * (s - distance_toP[sj]));
#if compile == 1
		printf("s = %lf\n", s);
		printf("edge[%d] = %lf distance_toP[%d] = %lf distance_toP[%d] = %lf\n", si, edge[si], si, distance_toP[si], sj, distance_toP[sj]);
		printf("area[si] = %lf\n", result);
#endif
	}
	else
	{
		s = (edge[si] + distance_toP[si] + distance_toP[sj]) / 2;
		result = sqrt(s * (s - edge[si]) * (s - distance_toP[si]) * (s - distance_toP[sj]));
#if compile == 1
		printf("s = %lf\n", s);
		printf("edge[%d] = %lf distance_toP[%d] = %lf distance_toP[%d] = %lf\n", si, edge[si], si, distance_toP[si], sj, distance_toP[sj]);
		printf("area[si] = %lf\n", result);
#endif
	}
	si++;
	sj++;
#if compile == 1
	puts("");
#endif
	return result;
}

double func_cal_areaT(double edge[], int n)
{
	double s = 0, result = 0;
	int i = 0;
	for(i = 0; i < n; i++)
	{
		s += (edge[i] / 2);
	}
	result = sqrt(s * (s - edge[0]) * (s - edge[1]) * (s - edge[2]));
	return result;
}

void func_output(int x)
{
	if(x == TRUE)
	{
		puts("YES");
	}
	else
	{
		puts("NO");
	}
}

C++: #include <iostream>
#include <math.h>
using namespace std;
double getCross( double x1, double y1, double x2, double y2 )
{
	return x1 * y2 - y1 * x2;
}
int main( void )
{
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while ( cin >> x1 >> y1 >> x2 >> y2>> x3 >> y3 >> xp >> yp )
	{
		double a = getCross( xp-x1, yp-y1, xp-x2, xp-y2 );
		double b = getCross( xp-x2, yp-y2, xp-x3, yp-y3 );
		double c = getCross( xp-x3, yp-y3, xp-x1, yp-y1 );

		if ( a < 0 || b < 0 || c < 0 )
			cout << "NO" << endl;
		else
			cout << "YES" << endl;

	}
	return 0;
}

C++: /*

Parallelism(https://onlinejudge.u-aizu.ac.jp/problems/0021)
前

*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
#include <complex>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cassert>
#include <iomanip>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define bitcnt(x) __builtin_popcount(x)
#define fst first
#define snd second
#define Pqaz(T) priority_queue<T,vector<T>,greater<T>>
#define Pqza(T) priority_queue<T>
#define put(x) cout << x;
#define putsp(x) cout << x << ' ';
#define putln(x) cout << x << endl;
#define ENJYU std::ios::sync_with_stdio(false);std::cin.tie(0);

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef complex<double> comp;
typedef vector <int> vec;
typedef vector <ll> vecll;
typedef vector <double> vecd;
typedef vector <vec> mat;
typedef vector <vecll> matll;
typedef vector <vecd> matd;

//vector の中身を出力
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

const int MAX = 200000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const ll INFL = 1e18;
const int MOD = 1000000007;

int dx4[4]={1,0,-1,0};
int dy4[4]={0,1,0,-1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

//********************************template END****************************************//

//外積を計算する関数
double gaiseki(comp a, comp b)
{
	return (conj(a)*b).imag();
}

void solve(void){

	double xs[4], ys[4];

	while(cin >> xs[0] >> ys[0])
	{

		rep(3, i)
		{
			cin >> xs[i+1] >> ys[i+1];
		}

		vector <comp> ps(4);
		rep(4, i)
		{
			ps[i] = comp(xs[i], ys[i]);
		}

		int cnt = 0, on = 0;

		rep(3, i)
		{
			if (gaiseki(ps[i]-ps[3], ps[(i+1)%3]-ps[3]) > 0)
			{
				cnt++;
			}
			else if (gaiseki(ps[i]-ps[3], ps[(i+1)%3]-ps[3]) < 0)
			{
				cnt--;
			}
			else
			{
				//辺上にあるかのフラグ
				on = 1;
			}

			//cout << cnt << endl;

		}

		cout << ((abs(cnt) != 3 || on) ? "NO" : "YES") << endl;

	}

}

int main(void){
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}