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<iostream>
#include<string>
using namespace std;

double x[4],y[4];
string judge ();

int main() {
	while ( cin >> x[0] ) {
		for( int i = 0; i < 4; i++ ){
			if ( !i )
				cin >> y[i];
			else
				cin >> x[i] >> y[i];
		}
		
		cout <<  judge () << endl;
		
	}
	return 0;
}

string judge () {
	string res;
	double a,b;
	int n,nn;
	
	for ( int i = 0; i < 3; i++ ) {
		if ( i == 2 ){
			n = '0';
			nn = n + 1;
		}else if ( i == 1 ){
			n = i + 1;
			nn = '0';
		}else{
			n = i + 1;
			nn = n + 1;
		}
		
		a = (y[n] - y[i]) / (x[n] - x[i]);
		b = (x[i] * y[n] - x[n] * y[i]) / (x[i] - x[n]);
		
		if ( (a * x[3] + b) > y[3] && (a * x[nn] + b) < y[nn] || (a * x[3] + b) < y[3] && (a * x[nn] + b) > y[nn] ) {
			return "NO";
		}
	}
	return "YES";
	
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

struct pos{
	double x;
	double y;
};
int main() {
		vector<pos> point(4);
		REP(j,4){
			cin >> point[j].x >> point[j].y;
		}
		bool yes=true;
		REP(j, 3){
			double cross = (point[(j + 1) % 3].x - point[(j) % 3].x)*(point[3].x - point[(j) % 3].x) + (point[(j + 1) % 3].y - point[(j) % 3].y)*(point[3].y - point[(j) % 3].y);
			if (cross <= 0){
			yes=false;
			}
		}
		if (yes)
		cout << "YES"<<endl;
		else
		cout << "NO" << endl;
}

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

void couten(double x[], double y[], double &cx, double &cy){
	double a2, b2, c2, a, b, c, s, S2;
	a2 = abs((x[2]-x[1])*(x[2]-x[1]) + (y[2]-y[1])*(y[2]-y[1]));
    b2 = abs((x[0]-x[2])*(x[0]-x[2]) + (y[0]-y[2])*(y[0]-y[2]));
    c2 = abs((x[1]-x[0])*(x[1]-x[0]) + (y[1]-y[0])*(y[1]-y[0]));
    a = sqrt(a2); b = sqrt(b2); c = sqrt(c2);
    s = (a + b + c) / 2;
    S2 = s * (s-a) * (s-b) * (s-c);
	cx = (a2*(b2+c2-a2)*x[0] + b2*(c2+a2-b2)*x[1] + c2*(a2+b2-c2)*x[2]) / (16 * S2);
    cy = (a2*(b2+c2-a2)*y[0] + b2*(c2+a2-b2)*y[1] + c2*(a2+b2-c2)*y[2]) / (16 * S2);
}

int hantei(double x[], double y[], double &cx, double &cy, double xp, double yp){
	bool flag[3];
	double tc, tp, tcc, tpp;
	x[3] = x[0]; y[3] = y[0];
	for(int i = 0; i < 3; i++){
		tc = (x[i] - x[i + 1]) * (cy - y[i]) + (y[i] - y[i + 1]) * (x[i] - cx);
		tp = (x[i] - x[i + 1]) * (yp - y[i]) + (y[i] - y[i + 1]) * (x[i] - xp);
		if(tc * tp >= 0){
			flag[i] = true;
		} else{
			continue;
		}
	}
	if(flag[0] == true && flag[1] == true && flag[2] == true){
		return 1;
	} else{
		return 0;
	}
}


int main(){
	double x[3], y[3], xp, yp, cxx, cyy;
	double &cx = cxx, &cy = cyy;
	
	while(cin >>x[0] >>y[0] >>x[1] >>y[1] >>x[2] >>y[2] >>xp >>yp){
		couten(x, y, cx, cy);
		if(hantei(x, y, cx, cy, xp, yp)){
			cout <<"Yes"<<endl;
		} else{
			cout <<"No"<<endl;
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;
 
#define rep(i,n) for(int i=0;i<int(n);++i)
 
static const double PI=6*asin(0.5);
typedef complex<double> P;
typedef long long ll;
static const double eps = 1e-8;
 
double x[3],y[3];
double xp,yp;
 
double dist(P a,P b){
    return (sqrt((real(a)-real(b))*(real(a)-real(b))+(imag(a)-imag(b))*(imag(a)-imag(b))));
}
 
double tri_pro(P a,P b){

    double s = real(a)*imag(b)-real(b)*imag(a);
    return s>0?s:0;
}
 
 
int main(){
    //P a(0.0,0.0),b(4.0,0.0),c(4.0,2.0);
    //cout<<tri_pro(a,b,c)<<endl;
    
    
    
    while(cin>>x[0]>>y[0]){
        rep(i,2) cin>>x[i+1]>>y[i+1];
        cin>>xp>>yp;
        P a(x[0],y[0]),b(x[1],y[1]),c(x[2],y[2]);
        P p(xp,yp);
        b-=a; c-=a; p-=a;
        bool f=true;
        if((tri_pro(b,p)>0&&tri_pro(c,p)>0)||(tri_pro(p,b)&&tri_pro(p,c))) f=false;
        if(f) cout<<"YES\n";
        else cout<<"NO\n";
    }
    
    return 0;
}

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

int main(){
	int n;
	double x1, y1, x2, y2, x3, y3, xp, yp, x ,y ,z;

	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
		x = (x1 - x3) * (yp - y1) - (y1 - y3) * (xp - x1);
		y = (x2 - x1) * (yp - y2) - (y2 - y1) * (xp - x2);
		z = (x3 - x2) * (yp - y3) - (y3 - y2) * (xp - x3);
		if ((x > 0 && y > 0 && z > 0) || (x < 0 && y < 0 && z < 0)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

C++: #include <iostream>
#include <complex>
using namespace std;
  
double cross(complex<double> A, complex<double> B){
	return (conj(A)*B).imag();
}
 
int main(){
    complex<double> V[3], P;
    while(true){
        double x, y;
        for(int i=0; i<3; i++){
            cin >> x >> y;
            V[i] = {x, y};
        }
        cin >> x >> y;
        P = {x, y};
         
        if(!cin)break;
         
        int sum = 0;
        for(int i=0; i<3; i++){
            sum += cross(V[(i+1)%3]-V[i], (P-V[i])) > 0;
        }
        cout << (sum==0 || sum==3? "YES": "NO") << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <math.h>

using namespace std;

typedef struct Point {
    double x;
    double y;
} POINT;

double area(Point l, Point m, Point n);

int main() {
    while (cin) {
        Point a, b, c, p;
        cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> p.x >> p.y;
        if (area(a, b, c) == area(a, b, p) + area(b, c, p) + area(c, a, p)) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        } 
    }
}

double area(Point l, Point m, Point n) {
    return fabs( (m.x - l.x) * (n.y - l.y)
            - (m.y - l.y) * (n.x - l.x)) * 0.5;
}