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 <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl

double xx[3], yy[3], x, y;

void solve(){
	double v1[2], vp[2];
	bool sign[3];
	rep(i,3){
		v1[0]=xx[(i+1)%3]-xx[i];
		v1[1]=yy[(i+1)%3]-yy[i];
		vp[0]=x-xx[i];
		vp[1]=y-yy[i];
		
		if(v1[0]*vp[1] - v1[1]*vp[0]>0)sign[i]=true;
		else sign[i]=false;
	}
	if((sign[0]&&sign[1]&&sign[2]) || (!sign[0]&&!sign[1]&&!sign[2]))puts("YES");
	else puts("NO");
}

int main(){
	
	while(cin>>xx[0]){
		cin>>yy[0]>>xx[1]>>yy[1]>>xx[2]>>yy[2]>>x>>y;
		solve();
	}
	
	return 0;
}

C++: #include<cstdio>
using namespace std;
struct Vec2 {
  double x, y;
  Vec2(double x_, double y_) : x(x_), y(y_) {}
};

bool in_the_triangle(const Vec2& a, const Vec2& b, const Vec2& c, const Vec2& p) {
  Vec2 aa(a.x-p.x, a.y-p.y);
  Vec2 bb(b.x-p.x, b.y-p.y);
  Vec2 cc(c.x-p.x, c.y-p.y);
  double k = aa.x*bb.y - bb.x*aa.y;
  double l = bb.x*cc.y - cc.x*bb.y;
  double m = cc.x*aa.y - aa.x*cc.y;
  return (k * l > 0 && k * m > 0);
}

int main() {
double a,b,c,d,e,f,g,h;
while (scanf("%f%f%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f,&g,&h)) {
  puts(in_the_triangle(Vec2(a,b),Vec2(c,d),Vec2(e,f),Vec2(g,h)) ? "YES" : "NO");
}
return 0;
}

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

int z(double x1, double y1, double x2, double y2) {
    return (0 < x1 * y2 - y1 * x2 ? 1 : -1);
}

int main() {
    double x[3], y[3], xp, yp;
    while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) {
        int sum = 0;
        for (int i=0; i<3; ++i) {
            sum += z(x[(i+1)%3] - x[i], y[(i+1)%3] - y[i], xp - x[i], yp - y[i]);
        }
        cout << (abs(sum) == 3 ? "YES" : "NO") << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

using db = double;
const db eps = 1e-6;

struct poi {
	db x, y;
	void r() { cin >> x >> y; }
	poi operator -(poi p) {
		return {x - p.x, y - p.y};
	}
	db cross(poi p) {
		return x * p.y - y * p.x;
	}
};
db xmul(poi a, poi b, poi c) {
	return (b - a).cross(c - a);
}

int main() {
	ios :: sync_with_stdio(false);
	poi a, b, c, p;
	while(cin >> a.x >> a.y) {
		b.r(); c.r(); p.r();
		db s = abs(xmul(a, b, c));
		db t = abs(xmul(p, a, b)) + abs(xmul(p, b, c)) + abs(xmul(p, c, a));
		if(s < t + eps && t < s + eps)
			cout << "YES\n";
		else
			cout << "NO\n";
	}
	return 0;
}

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

int judge(pair<double, double> p1, pair<double, double> p2){
	int S = p1.first*p2.second - p2.first*p1.second;
	if (0 < S) return 1;
	if (0 > S) return -1;
	if (0 == S) return 0;
}

int main(){
	pair<double, double> A, B, C, P;

	while (cin >> A.first >> A.second >> B.first >> B.second >> C.first >> C.second >> P.first >> P.second){
		pair<double, double> AB, BC, CA, AP, BP, CP;
		AB = { B.first - A.first, B.second - A.second };
		BC = { C.first - B.first, C.second - B.second };
		CA = { A.first - C.first, A.second - C.second };
		AP = { P.first - A.first, P.second - A.second };
		BP = { P.first - B.first, P.second - B.second };
		CP = { P.first - C.first, P.second - C.second };
		
		if (judge(AP, AB) == judge(BP, BC) && judge(BP, BC) == judge(CP, CA) && judge(CP, CA) == judge(AP, AB)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}

	return 0;
}

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

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

double x[4], y[4];
int main() {
  while (1) {
    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 && pab * pca >= 0);
    cout << (ok ? "YES" : "NO") << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define rrep(i,n) for(int (i)=1;i<=(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define INF 1e18
#define int long long
#define endl "\n"
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};

double x, y;

bool cross(double a, double b, double c, double d) {
	return (c-a) * (y-b) - (x-a) * (d-b) > 0;
}

signed main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	
	double a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f >> x >> y) {
		int cnt = 0;
		cnt += cross(a, b, c, d);
		cnt += cross(c, d, e, f);
		cnt += cross(e, f, a, b);
		if(cnt == 0 || cnt == 3) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#define EPS 1.0e-5
using namespace std;

int main() {
  double x1,y1,x2,y2,x3,y3,xp,yp;
  double a[2],b[2];
  double A,B;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    a[0] = x2 - x1;
    a[1] = y2- y1;
    b[0] = x3 - x1;
    b[1] = y3 - y1;
    if(fabs(a[0] * b[1] -b[0] * a[1]) > 0) {
      A = ( b[1] * xp - b[0] * yp) / (a[0] * b[1] - b[0] * a[1]);
      B = (a[0] * yp - xp * a[1]) / (a[0] * b[1] - b[0] * a[1]);
      if ((A+B < 1) && (A > 0) && (B > 0)) {
        cout << "YES" << endl;
      }
      else {
        cout << "NO" << endl;
      }
    }
    else
      cout << "NO" << endl;
  }
}