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 <bits/stdc++.h>
using namespace std;

using uint=unsigned;
using ll=long long;
using ull=unsigned long long;
#define int ll

#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=a;i--)
#define per(i,b) gnr(i,0,b)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define fs first
#define sc second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif
#define tmp template<class t>

tmp void chmax(t&a,t b){if(a<b)a=b;}
tmp void chmin(t&a,t b){if(a>b)a=b;}

tmp using vc=vector<t>;
tmp using vvc=vc<vc<t>>;

using pi=pair<int,int>;
using vi=vc<int>;

template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p.fs<<","<<p.sc<<"}";
}

tmp ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}

constexpr ll ten(int n){
	return n==0?1:ten(n-1)*10;
}

tmp void mkuni(vc<t>&v){
	sort(all(v));
	v.erase(unique(all(v)),v.ed);
}

ll read(){ll i;cin>>i;return i;}

using ld=long double;
using cm=complex<ld>;
#define x real()
#define y imag()
const ld eps=1e-12;
int sgn(ld a){return a<-eps?-1:(a>eps?1:0);}
auto cmcmp=[](const cm&a,const cm&b){
	if(sgn(a.x-b.x))return a.x<b.x;
	else return sgn(a.y-b.y)<0;
};

struct ln{
	cm a,b;
	cm dir(){return b-a;}
};
ld dot(cm a,cm b){return a.x*b.x+a.y*b.y;}
ld crs(cm a,cm b){return a.x*b.y-a.y*b.x;}
int ccw(cm a,cm b){return sgn(crs(a,b));}
int ccw(cm a,cm b,cm c){return ccw(b-a,c-a);}
int ccw(ln a,cm b){return ccw(a.a,a.b,b);}

//(-2)[a,-1](0)[b,1](2)
int bet(cm a,cm b,cm c){
	cm d=b-a;
	ld e=dot(d,c-a);
	if(sgn(e)<=0)return sgn(e)-1;
	return sgn(e-norm(d))+1;
}

ld tri2(cm a,cm b,cm c){
	return crs(b-a,c-a);
}

cm readcm(){
	ld a,b;
	cin>>a>>b;
	return cm(a,b);
}

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(20);
	
	while(1){
		cm a=readcm();
		cm b=readcm();
		cm c=readcm();
		cm d=readcm();
		if(cin.eof())break;
		if(ccw(a,b,c)==-1)
			swap(b,c);
		if(min({ccw(a,b,d),ccw(b,c,d),ccw(c,a,d)})==1)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#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++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

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


int main(){
	ios::sync_with_stdio(false);

	vd x(3), y(3);
	double px, py;
	double a1, a2, a3;
	bool s = false;

	while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){

		a1 = (x[1] - x[0])*(py - y[1]) - (y[1] - y[0])*(px - x[1]);
		a2 = (x[2] - x[1])*(py - y[2]) - (y[2] - y[1])*(px - x[2]);
		a3 = (x[0] - x[2])*(py - y[0]) - (y[0] - y[2])*(px - x[0]);

		if (((a1 > 0) && (a2 > 0) && (a3 > 0)) || ((a1 < 0) && (a2 < 0) && (a3 < 0)))
			s = !s;

		if (s)
			puts("YES");
		else
			puts("NO");
	}
}

C++: #include <iostream>
#include <vector>

#define EPS (1e-10)

using namespace std;

double crossProduct(double px, double py, double x1, double y1, double x2, double y2) {
  double v1[2] = {px - x1, py - y1};
  double v2[2] = {x2 - x1, y2 - y1};
  return v1[0] * v2[1] - v1[1] * v2[0];
}

int main() {
  double x1, x2, x3, xp, y1, y2, y3, yp;
  double t[3];
  int f;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    t[0] = crossProduct(xp, yp, x1, y1, x2, y2);
    t[1] = crossProduct(xp, yp, x2, y2, x3, y3);
    t[2] = crossProduct(xp, yp, x3, y3, x1, y1);
    for (int i = f = 0; i < 3; i++) {
      if (t[i] < -EPS) f++;
      else if (t[i] > EPS) f--;
      else return -1;
    }
    if (f == 3 || f == -3) cout << "YES\n";
    else cout << "NO\n";
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 1e9 + 7;
using pii = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
const int mod = 1e9 + 7;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
using Point = complex<double>;
double dot(Point a, Point b) {return real(conj(a) * b);}
double cross(Point a, Point b) {return imag(conj(a) * b);}
const double eps = 1e-10;
int main() {
    double xa, ya, xb, yb, xc, yc, xp, yp;
    while (cin >> xa >> ya >> xb >> yb >> xc >> yc >> xp >> yp) {
        double tmp = abs(cross(Point(xb - xa, yb - ya), Point(xc - xa, yc - ya)));
        double sum = 0;
        sum += abs(cross(Point(xb - xp, yb - yp), Point(xc - xp, yc - yp)));
        sum += abs(cross(Point(xa - xp, ya - yp), Point(xc - xp, yc - yp)));
        sum += abs(cross(Point(xa - xp, ya - yp), Point(xb - xp, yb - yp)));
        if (abs(tmp - sum) < eps) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    
}

C++: #include <cstdio>
#include <iostream>
#include <complex>
#define rep(i,n) for(int i=0; i<(n); i++)
#define EPS 1e-10
using namespace std;

typedef complex<double> cd;

double s(cd a, cd b){
  return double(a.real()*b.imag()-a.imag()*b.real());
}

int main(){
  cd a[4];

  for(;;){
    rep(i,4){
      double x,y;
      if(!~scanf(" %lf %lf", &x,&y))
        return 0;
      a[i]=cd(x,y);
    }
    
    if((s(a[0]-a[3], a[1]-a[3]) > 0 && 
        s(a[1]-a[3], a[2]-a[3]) > 0 &&
        s(a[2]-a[3], a[1]-a[3]) > 0 ) ||
       (s(a[0]-a[3], a[1]-a[3]) < 0 && 
        s(a[1]-a[3], a[2]-a[3]) < 0 &&
        s(a[2]-a[3], a[1]-a[3]) < 0 ))
      printf("IN\n");
    else
      printf("OUT\n");
  }
  
  return 0;
}

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

#define X real()
#define Y imag()
#define PI M_PI
#define EPS (1e-10)
typedef complex<double> point;

double angle(point a,point b,point c){ //?§????????¨????????????¢??°
	double A=abs(b-c);
	double B=abs(c-a);
	double C=abs(a-b);
	return acos((B*B+C*C-A*A)/(2.0*B*C)); //??????????????????
}

bool judge(point p,point a,point b,point c){
	double A=angle(p,a,b);
	double B=angle(p,b,c);
	double C=angle(p,c,a);
	return (abs(A+B+C-2*PI)<EPS)? true : false;
}

int main(void){
	point a,b,c,p;
	double x1,y1,x2,y2,x3,y3,xp,yp;

	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
		a.X=x1; a.Y=y1;
		b.X=x2; b.Y=y2;
		c.X=x3; c.Y=y3;
		p.X=xp; p.Y=yp;
		if(judge(p,a,b,c)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}