Go: package main

import (
        "fmt"
)

func main() {
        var x1, y1, x2, y2, x3, y3, px, py float64
        var oax, oay, obx, oby, opx, opy float64
        var det float64
        var s, t float64

        for {
                _, err := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py)
                if err != nil {
                        break
                }
                oax = x2 - x1
                oay = y2 - y1
                obx = x3 - x1
                oby = y3 - y1
                opx = px - x1
                opy = py - y1
                det = oax*oby - obx*oay

                if det == 0 {
                        fmt.Printf("NO\n")
                } else {
                        s = (oby*opx - obx*opy) / det
                        t = (oax*opy - oay*opx) / det

                        if (s+t < 1 && s > 0 && t > 0) {
                                fmt.Printf("YES\n")
                        } else {
                                fmt.Printf("NO\n")
                        }
                }
        }
}

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

C++: #include <complex>
#include <cmath>
#include <iostream>
using namespace std;
typedef complex<double> xy_t;

double x[4], y[4];

double cross_product(xy_t a, xy_t b) { return (conj(a)*b).imag(); }

int main() {
  while (true) {
    for (int i=0; i<4; ++i) cin >> x[i] >> y[i];
    if (!cin) break;
    xy_t a(x[0],y[0]), b(x[1],y[1]), c(x[2],y[2]), p(x[3],y[3]);
    double pab = cross_product(a-p,b-p);
    double pbc = cross_product(b-p,c-p);
    double pca = cross_product(c-p,a-p);

    bool ok = pab*pbc>0 && pbc*pca>0;
    cout << (ok ? "YES" : "NO") << endl;
  }
}

C++: #include<iostream>
#include<complex>
using namespace std;
typedef complex<double> p;

int main()
{
	p a,b,c,d;
	while(cin>>a.real()>>a.imag()>>b.real()>>b.imag()>>c.real()>>c.imag()>>d.real()>>d.imag())
	{
		a=a-d; 
		b=b-d; 
		c=c-d;

		double ab=a.real()*b.imag()-a.imag()*b.real();
		double bc=b.real()*c.imag()-b.imag()*c.real();
		double ca=c.real()*a.imag()-c.imag()*a.real();

		if(ab<0&&bc<0&&ca<0) cout<<"YES"<<endl;
		else if(ab>0&&bc>0&&ca>0) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <complex>
#include <vector>
#include <cmath>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

typedef complex<double> P;
typedef vector<P> VP;
const double EPF = 1e-9;

#define X real()
#define Y imag()
#define EQ(x,y) (abs(x-y) < EPF)

double dot(P a, P b) {
  return (conj(a)*b).X;
}
double cross(P a, P b) {
  return (conj(a)*b).Y;
}
double distPP(P a, P b) {
  return sqrt(dot(a-b,a-b));
}
P crosspoint(P a, P b, P c, P d) {//ac , bd
  double d1 = cross(d-b,b-a);
  double d2 = cross(d-b,c-a);
  if(EQ(d1,0) & EQ(d2,0)) return a;
  if(EQ(d2,0)) return a;
  return a + (c-a)*d1/d2;
}
P normal_vector(P a) {
  P b(-a.Y, a.X);
  return b;
}


int main() {
  VP vp;

  while(1) {
    REP(i,4) {
      double x,y;
      if(scanf("%lf %lf", &x, &y) == EOF) {
	vp.clear();
	return 0;
      }
      vp.push_back(P(x,y));
    }
    double d1 = cross(vp[1]-vp[0],vp[3]-vp[0]);
    double d2 = cross(vp[2]-vp[1],vp[3]-vp[1]);
    double d3 = cross(vp[0]-vp[2],vp[3]-vp[2]);
    if((d1 > 0 && d2 > 0 && d3 > 0) || (d1 < 0 && d2 < 0 && d3 < 0)) printf("YES\n");
    else printf("NO\n");
    vp.clear();
  }
  
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

double x[3], y[3], xp, yp;

double cross(int a, int b){
    return x[a] * y[b] - y[a] * x[b];
}

signed main(){
    while(1){
        if(cin.eof()) break;        
        rep(i, 0, 3) cin >> x[i] >> y[i];
        cin >> xp >> yp;
        rep(i, 0, 3){
            x[i] -= xp;
            y[i] -= yp;
        }
        bool f = true;
        rep(i, 0, 3){
            if(cross(i, (i + 1) % 3) * 10000 < 0) f = false; 
        }
        cout << (f ? "YES" : "NO") << endl;
    }
}