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 <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>

#define PI 3.14159265359

#define INF 99999999;

#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)

typedef long long ll;

using namespace std;



/*
class TheKingsArmyDiv2
{
public:
	int getNumber(vector <string> state)
	{

	}
};
*/




int main()
{
	double x1, y1, x2, y2, x3, y3, xp, yp;
	double s, t;
	
	while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF)
	{
		s = ((xp - x1) * (y3 - y1) - (yp - y1) * (x3 - x1)) /
			((x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1));
		t = ((xp - x1) * (y2 - y1) - (yp - y1) * (x2 - x1)) /
			((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));
		
		if (s > 0 && t > 0 && s + t < 1)
		{
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	
	return 0;
}

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

double cross(P a, P b) {
  return (a.real()*b.imag()-a.imag()*b.real());
}

P vector_coord(P a, P b, P x){
  return P(-cross(b,x),cross(a,x))/cross(a,b);
}

int main(){
  double a1,b1,a2,b2,a3,b3,x1,y1;
  while(cin >>a1 >>b1 >>a2 >>b2 >>a3>>b3>>x1>>y1){
  P o=P(a1,b1);
  P a=P(a2,b2)-o;
  P b=P(a3,b3)-o;
  P x=P(x1,y1)-o;
  P v = vector_coord(a,b,x);
  if (0<v.real()&&0<v.imag()&&v.real()+v.imag()<1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
using namespace std;

int main(){
    double x1, x2, x3, y1, y2, y3, xp, yp;
    while (cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
        double v1, v2, v3;
        v1 = (x1-x2)*(y1-yp) - (y1-y2)*(x1-xp);
        v2 = (x2-x3)*(y2-yp) - (y2-y3)*(x2-xp);
        v3 = (x3-x1)*(y3-yp) - (y3-y1)*(x3-xp);
        //printf("%f %f %f\n", v1, v2, v3);
        if ( (v1 < 0 && v2 < 0 && v3 < 0) || (v1 > 0 && v2 > 0 && v3 > 0) ) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}

C++: #include <iostream>
#include <math.h>
using namespace std;
double getCross( double x1, double y1, double x2, double y2 )
{
	return x1 * y2 - y1 * x2;
}
int main( void )
{
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while ( cin >> x1 >> y1 >> x2 >> y2>> x3 >> y3 >> xp >> yp )
	{
		double a = getCross( xp-x1, yp-y1, xp-x2, xp-y2 );
		double b = getCross( xp-x2, yp-y2, xp-x3, yp-y3 );
		double c = getCross( xp-x3, yp-y3, xp-x1, yp-y1 );

		if ( a < 0.0 || b < 0.0 || c < 0.0 )
			cout << "NO" << endl;
		else
			cout << "YES" << endl;

	}
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <stdio.h>

#define MAX 1000000

using namespace std;

int main()
{
	double x1,y1,x2,y2,x3,y3,xp,yp,z1,z2,z3;
	int n;

	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
	{

		z1=(x2-x1)*(yp-y1)-(y2-y1)*(xp-x1);
		z2=(x3-x2)*(yp-y2)-(y3-y2)*(xp-x2);
		z3=(x1-x3)*(yp-y3)-(y1-y3)*(xp-x3);

		
		if((z1>0&&z2>0&&z3>0)||(z1<0&&z2<0&&z3<0)) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef complex<double> P;
typedef vector<P> G;
inline double dot(const P& a, const P& b) { return real(conj(a)*b);}
inline double cross(const P& a, const P& b) { return imag(conj(a)*b);}

#define curr(g, i) g[i]
#define next(g, i) g[(i+1)%g.size()]
enum { OUT, ON, IN };
int contains(const G& g, const P& p) {
    bool in = false;
    for (int i = 0; i < g.size(); ++i) {
        P a = curr(g,i) - p, b = next(g,i) - p;
        if (imag(a) > imag(b)) swap(a, b);
        if (imag(a) <= 0 && 0 < imag(b))
            if (cross(a, b) < 0) in = !in;
        if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
    }
    return in ? IN : OUT;
}

int main(){
    G g(3);
    P p;
    while(~scanf("%lf %lf %lf %lf %lf %lf %lf %lf",
                 &g[0].real(), &g[0].imag(), &g[1].real(), &g[1].imag(), &g[2].real(), &g[2].imag(),
                 &p.real(), &p.imag())){
        cout << (contains(g,p)==IN? "YES": "NO") << endl;
    }
}

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

using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)

bool judge(double x[3], double y[3]) {
	double rad1 = atan2(y[0], x[0]);
	rad1 += acos(-1);
	double rad2 = atan2(y[1], x[1]);
	rad2 += acos(-1);
	double rad3 = atan2(y[2], x[2]);
	rad3 += acos(-1);
	if(rad3 < rad1 && rad2 < rad3 || rad1 < rad3 && rad3 < rad2) return true;
	else return false;
}

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
		double x[3], y[3];
		x[0] = x2 - x1;
		y[0] = y2 - y1; 
		x[1] = x3 - x1;
		y[1] = y3 - y1;
		x[2] = xp - x1;
		y[2] = yp - y1;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			continue;
		}
		x[0] = x1 - x2;
		y[0] = y1 - y2;
		x[1] = x3 - x2;
		y[1] = y3 - y2;
		x[2] = xp - x2;
		y[2] = yp - y2;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			continue;
		}
		cout << "YES" << endl;
	}
	return 0;
}

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

typedef complex<double> Point;

double cross(Point a, Point b){
    return (conj(a)*b).imag();
}

int main(){
    Point 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<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>

#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)

int main(){
	double x[4], y[4];
	bool left, right;
	double ax, ay, px, py;

	while(1){
		for(int i = 0; i < 4; i++){
			if(!(cin >> x[i] >> y[i])){
				return 0;
			}
		}

		left = false;
		right = false;
		for(int i = 0; i < 3; i++){
			ax = x[(i+1)%3]-x[i];
			ay = y[(i+1)%3]-y[i];
			px = x[3] - x[i];
			py = y[3] - y[i];
			if( ax*py-px*ay < 0){
				right = true;
			}else{
				left = true;
			}
		}

		if(left^right){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}

	return 0;
}