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++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>


using namespace std;
const int MOD = 1000000009; // check!!!
const int INF = 100000000; //1e8

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)(c).size())
#define ten(x) ((int)1e##x)
#define tenll(x) ((ll)1e##x)


const double EPS (1e-8);
const double PI=acos(-1.0);

template<class T>
struct point{
    T x,y;
    point() : x(0), y(0) {}
    point(const T& x,const T& y) : x(x), y(y) {}
    point operator+(const point &a)const{ return point(x+a.x,y+a.y); }
    point& operator+=(const point &a){x += a.x; y += a.y; return *this;}
    point operator-(const point &a)const{ return point(x-a.x,y-a.y); }
    point& operator-=(const point &a){x -= a.x; y -= a.y; return *this;}
    point operator*(const double a)const{ return point(a*x,a*y); }
    point& operator*=(const double a){ x *= a; y *= a; return *this;}
    point operator/(const double a)const{ return point(x/a,y/a); }
    point& operator/=(const double a){ x /= a; y /= a; return *this;}
	
	//比較用
	bool operator<(const point &a)const{return (x != a.x) ? (x < a.x) : (y < a.y);}
 
};

template<class T> T SQ(T x){ return x*x; }
template<class T> T dist2(const point<T> &a,const point<T> &b){return SQ(a.x-b.x)+SQ(a.y-b.y);}
template<class T> T abs2(const point<T>& p){return SQ(p.x) + SQ(p.y);}
template<class T> T abs(const point<T>& p){return sqrt(abs2(p));}
template<class T> T dot(const point<T>& a,const point<T>& b)
{return a.x*b.x + a.y*b.y;}
template<class T> T cross(const point<T>& a,const point<T>& b)
{return a.x*b.y - a.y*b.x;}
template<class T> point<T> rot(const point<T>& a,const double theta){
        return point<T>(a.x*cos(theta)-a.y*sin(theta),
			a.x*sin(theta)+a.y*cos(theta));
}
template<class T>
double arg(const point<T> &a){	double t=atan2(a.y,a.x); return t<0?t+2*PI:t; }

enum{CCW=1,CW=-1,ON=0};
template<class T>
int ccw(const point<T> &a,point<T> b,point<T> c){
	b -= a; c -= a;
    double rdir=cross(b,c);
    double len = abs(b) * abs(c); //誤差対策 (速度がやばい時は外すか、二乗に置き換える)
    if(rdir> EPS * len) return CCW; //cがabより上(反時計周り)
    if(rdir<-EPS * len) return CW; // cがabより下(時計周り)
    return ON; // a,b,cが一直線上
}

//多角形の面積
template<class T>
T area(const vector<point<T> >& v){
	T ans = 0;
	for (int i = 2; i < (int)v.size(); i++){
		ans += cross(v[i-1] - v[0],v[i] - v[0]);
	}
	return abs(ans) / 2;
}

typedef point<double> P;

double ar(P& a,P& b,P& c){
	vector<P> v;
	v.push_back(a);
	v.push_back(b);
	v.push_back(c);
	return area(v);
}

template<class T>
std::istream& operator>>(std::istream& is, point<T>& point){return ( is >> point.x >> point.y );}


int main(){
	P p[4];
	while(true){
		p[0].x = INF;
		FOR(i,4) cin>>p[i];
		if(p[0].x == INF) break;

		if(ar(p[0],p[1],p[2]) + EPS >= ar(p[0],p[1],p[3]) + ar(p[0],p[2],p[3]) + ar(p[1],p[2],p[3])){
			puts("YES");
		} else {
			puts("NO");
		}

	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

double dist(double x1, double y1, double x2, double y2){
    return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}

double triangleArea(double x, double y, double z){
    return (y * z * sin( acos( (y * y +  z * z - x * x) / (2 * y * z) ) )) / 2;
}

double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
    double x, y ,z;
    x = dist(x1, y1, x2, y2);
    y = dist(x2, y2, x3, y3);
    z = dist(x3, y3, x1, y1);
    return triangleArea(x, y, z);
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    double allArea, area12, area23, area31;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
    allArea = inputXY(x1, y1, x2, y2, x3, y3);
    area12 = inputXY(xp, yp, x2, y2, x1, y1);
    area23 = inputXY(x2, y2, x3, y3, xp, yp);
    area31 = inputXY(x3, y3, x1, y1, xp, yp);

    if(abs(allArea - (area12 + area23 + area31)) < 0.000000000000001) cout << "YES" << endl;
    else cout << "NO" << endl;

}

C++: #include<iostream>
typedef float f;f a,b,c,d,h,i,e,g;f r(f k,f l,f m,f n){m-=k;n-=l;k=e-k;l=g-l;return m*l-n*k?m*l-n*k>0?1:-1:0;}int main(){for(;!(std::cin>>a>>b>>c>>d>>h>>i>>e>>g).eof();)std::cout<<(r(a,b,c,d)==r(c,d,h,i)==r(h,i,a,b)?"YES\n":"NO\n");}

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

using namespace std;

bool cross(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
	double ab=(y1-y2)/(x1-x2)*(x3-x1)+y1, cd=(y1-y2)/(x1-x2)*(x4-x1)+y1;
	if ((ab>y3&&cd>y4)||(ab<y3&&cd<y4)) return false;
	return true;
}

int main() {
	double x1, x2, x3, y1, y2, y3, xp ,yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		double xm = (x1+x2+x3)/3, ym = (y1+y2+y3)/3;
		if (cross(x1,y1,x2,y2,xm,ym,xp,yp)||cross(x2,y2,x3,y3,xm,ym,xp,yp)||cross(x3,y3,x1,y1,xm,ym,xp,yp)) {
			cout << "NO" << endl;
		} else {
			cout << "YES" << endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<cstring>
using namespace std;
//long long int arr[1000000];
int main()
{
    double x1,x2,x3,y1,y2,y3,p,q,a1,a2,a3,at;
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&p,&q)==8)
    {
        at=((x1-x2)*(y2-y3)-(y1-y2)*(x2-x3));
        a1=((p-x2)*(y2-y3)-(q-y2)*(x2-x3));
        a2=((x1-p)*(q-y3)-(y1-q)*(p-x3));
        a3=((x1-x2)*(y2-q)-(y1-y2)*(x2-p));
        if((at)==(a1+a2+a3))
        printf("YES\n");
        else
        printf("NO\n");
    }
    return 0;
}