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++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

const double EPS=1e-10;
int sig(double r){return (r<-EPS)?-1:(r>EPS)?1:0;}

struct Pt{
	double x,y;
	Pt(){}
	Pt(double x,double y) : x(x),y(y) {}
	Pt operator+(const Pt &a) const {return Pt(x+a.x,y+a.y);}
	Pt operator-(const Pt &a) const {return Pt(x-a.x,y-a.y);}
	Pt operator*(const Pt &a) const {return Pt(x*a.x-y*a.y,x*a.y+y*a.x);}
	Pt operator-() const {return Pt(-x,-y);}
	Pt operator*(const double &k) const {return Pt(x*k,y*k);}
	Pt operator/(const double &k) const {return Pt(x/k,y/k);}
	double abs() const {return sqrt(x*x+y*y);}
	double abs2()const{return x*x+y*y;}
	double arg()const{return atan2(y,x);}
	double dot(const Pt&a)const{return x*a.x+y*a.y;}
	double det(const Pt&a)const{return x*a.y-y*a.x;}
	bool operator<(const Pt &a)const{return (x!=a.x)?(x<a.x):(y<a.y);}
	bool operator==(const Pt&a)const{return (sig(x-a.x)==0&&sig(y-a.y)==0);}
};
ostream &operator<<(ostream &os,const Pt &a){os<<"("<<a.x<<","<<a.y<<")";return os;}
double tri(Pt a, Pt b, Pt c){return (b-a).det(c-a);}
bool iLS(Pt a,Pt b,Pt c,Pt d){
	return (sig(tri(a,b,c))*sig(tri(a,b,d))<=0);
}
int main() {
	Pt a,b,c,x;
	for(;~scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y,&x.x,&x.y);){
		if(iLS(a,b,c,x)||iLS(a,c,b,x)||iLS(b,c,a,x)){
			puts("NO");
		}else{
			puts("YES");
		}
	}
	return 0;
}

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

double Area(double* x1, double* y1, double* x2, double* y2){
  return (*x1 * *y2 - *x2 * *y1)/2.0;
}

double Segitiga(double* a, double * b, double* c, double* d, double* e, double* f){
  return abs (Area(a,b,c,d) + Area(c,d,e,f) + Area(e,f,a,b));
}

int main(){
  double a, b, c, d, e, f, g, h, ta, tb;
  cin >> a >> b >> c >> d >> e >> f >> g >> h;
  ta = Segitiga(&a, &b, &c, &d, &e, &f);
  tb = Segitiga(&a, &b, &c, &d, &g, &h) + Segitiga(&a, &b, &e, &f, &g, &h) + Segitiga(&c, &d, &e, &f, &g, &h);

  if(tb-ta <= 1e-8)
    cout << "NO\n";
  else
    cout << "YES\n";
  
return 0;
}

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

double x1, y1, x2, y2, x3, y3, xp, yp;

int side(double p1_x, double p1_y, double p2_x, double p2_y){
	double n = xp*(p1_y - p2_y) + p1_x*(p2_y - yp) + p2_x*(yp - p1_y);
	if(n > 0) return 1; // left
	else if(n < 0) return -1; //right
	else return 0; //on_line
}

bool judge_in(){
	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
	int pab = side(x1,y1,x2,y2);
	int pbc = side(x2,y2,x3,y3);
	int pca = side(x3,y3,x1,y1);

	if((pab > 0) && (pbc > 0) && (pca > 0)) return true;
	if((pab < 0) && (pbc < 0) && (pca < 0)) return true;
	return false;
}


int main(){
	bool judge = judge_in();
	if(judge == true) cout << "YES" << endl;
	else if(judge == false) cout << "NO" << endl;
}

C++: #include <stdio.h>
#include <math.h>
#define out(x1,y1,x2,y2) x1 * y2 - x2 * y1

int main(void){
	double x[3], y[3], xp, yp;
	int i;
	for(i = 0;i < 3;i++)
		scanf("%lf%lf",&x[i],&y[i]);
	scanf("%lf%lf",&xp,&yp);
	if((out(xp - x[0],yp - y[0],x[1] - x[0],y[1] - y[0]) > 0 && out(xp - x[0],yp - y[0],x[2] - x[0],y[2] - y[0]) > 0 && out(xp - x[1],yp - y[1],x[2] - x[1],y[2] - y[1]) > 0) || (out(xp - x[0],yp - y[0],x[1] - x[0],y[1] - y[0]) < 0 && out(xp - x[0],yp - y[0],x[2] - x[0],y[2] - y[0]) < 0 && out(xp - x[1],yp - y[1],x[2] - x[1],y[2] - y[1]) < 0))
		printf("YES\n");
	else
		printf("NO\n");

	return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;

int main(){

	double x[3],y[3],px,py,x1,x2,y1,y2,f;
	int f3,i;
		
	while(scanf("%f%f%f%f%f%f%f%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&px,&py)>0){
		f3=0;
		for(i=0;i<3;i++){
			x1=x[i];
			y1=y[i];
			x2=x[(i+1)%3];
			y2=y[(i+1)%3];
			f=x1*(py-y2)+px*(y2-y1)+x2*(y1-py);
			if(f>0){
				f3++;
			}else if(f<0){
				f3--;
			}
			cout << f << endl;
		}
		if(abs(f3)==3)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

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

typedef complex<double> P;

double cross(P a,P b){
	return imag(a*conj(b));
}
double area(P a,P b,P c){
	return abs(cross(a-c,b-c));
}
bool on(P a,P b,P p){
	return abs(a-p) + abs(p-b) - abs(a-b) < 1e-9;
}


P in(){
	double x,y;
	if(cin >> x >> y)
		return P(x,y);
	else exit(0);
}
int main(){
	P a,b,c,d;
	while(true){
		a = in();
		b = in();
		c = in();
		d = in();
		if( !on(a,b,d) and !on(b,c,d) and !on(c,a,d) and area(a,b,d) + area(b,c,d) + area(c,a,d) - area(a,b,c) < 1e-9 )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define sz size()

const double EPS = 1e-10;
const int INF = 100000000;



int isPointInsidePolygon(vector<pair<double,double>> angle,pair<double,double> point){    //点が多角形の内側にあるかどうかを求める
    long angleSum=angle.size();
    int count=0;
    
    for(int i=0;i<angleSum;i++){
        double x1=angle[i].first;
        double y1=angle[i].second;
        double x2=angle[(i+1)%angleSum].first;
        double y2=angle[(i+1)%angleSum].second;
        double xp=point.first;
        double yp=point.second;
        
        double result=(x2-x1)*(yp-y1) - (xp-x1)*(y2-y1);
        
        if(result>0)count++;
        
    }
    if(count%angleSum==0)return 1;    //点は内側にある
    else return 0;
    
}



int main(){
    double a,b,c,d,e,f,g,h;
    while(cin>>a>>b>>c>>d>>e>>f>>g>>h){
        vector<pair<double,double>> angle;
        angle.pb(pair<double,double>(a,b));
        angle.pb(pair<double,double>(c,d));
        angle.pb(pair<double,double>(e,f));

        if(isPointInsidePolygon(angle,pair<double,double>(g,h))){
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
    }


    return 0;
}