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 <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>
#include<algorithm>

using namespace std;

struct L{
    L(double xa, double ya, double xb, double yb){
	if(xa > xb)swap(xa, xb), swap(ya, yb);
	x1 = xa;
	y1 = ya;
	x2 = xb;
	y2 = yb;
	if(xa-xb == 0){
	    a = 1;
	    b = 0;
	    c = -xa;
	}
	else {
	    a = (ya-yb);
	    b = (xb- xa);
	    c = -(a*xa + b*ya);
	}
    };
    double f(double x, double y){
	return a*x + b*y + c;
    }
    double a, b, c, x1, x2, y1, y2;//0 = ax + by + c [x1, x2]
};

bool cross(L a, L b){
    return (a.f(b.x1, b.y1) * a.f(b.x2, b.y2) < 0 && 
	    b.f(a.x1, a.y1) * b.f(a.x2, a.y2) < 0);
}

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

int main(){
    while(cin){
	cin >> x1 >> y1 >> x2 >> y2>> x3 >> y3 >> xp >> yp;
	L a = L(x1, y1, x2, y2);
	L b = L(x1, y1, x3, y3);
	L c = L(x2, y2, x3, y3);
	L p = L(xp, yp, 203, 103.141592);
	int res = 0;
	if(cross(a,p))res++;
	if(cross(b,p))res++;
	if(cross(c,p))res++;
	if(res % 2 == 0)cout << "NO" <<  endl;
	else cout << "YES"<<endl;}
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <list>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <math.h>

#define NITENKAN(a, b) sqrt(((a.first - b.first) * (a.first - b.first)) + ((a.second - b.second) * (a.second - b.second)))
using namespace std;

bool checkTriIn(pair<double, double> vA, pair<double, double> vB, pair<double, double> vC, pair<double, double> P){
	pair<double, double> center(((vA.first + vB.first + vC.first) / 3), ((vA.second + vB.second + vC.second) / 3));

	vector<pair<double, double> > triangleLine;
	vector<pair<double, double> > centerToVertex;
	pair<double, double> vAvB(vB.first - vA.first, vB.second - vA.second);
	pair<double, double> vBvC(vC.first - vB.first, vC.second - vB.second);
	pair<double, double> vCvA(vA.first - vC.first, vA.second - vC.second);

	triangleLine.push_back(vAvB);
	triangleLine.push_back(vBvC);
	triangleLine.push_back(vCvA);

	pair<double, double> centerP(P.first - center.first, P.second - center.second);
	pair<double, double> centerA(vA.first - center.first, vA.second - center.second);
	pair<double, double> centerB(vB.first - center.first, vB.second - center.second);
	pair<double, double> centerC(vC.first - center.first, vC.second - center.second);

	centerToVertex.push_back(centerA);
	centerToVertex.push_back(centerB);
	centerToVertex.push_back(centerC);

	for(int i = 0; i < 3; i++){
		double cross = triangleLine[i].first * centerP.second - centerP.first * triangleLine[i].second;
		if(cross == 0) continue;
		double r = triangleLine[i].first * centerToVertex[i].second - centerToVertex[i].first * triangleLine[i].second;
		r /= cross;
		double s = centerP.first * centerToVertex[i].second - centerToVertex[i].first * centerP.second;
		s /= cross;

		if(r > 0 && r <= 1 && s > 0 && s <= 1){
			return false;
		}
	}
	return true;
}

int main(){
	pair<double, double> vA, vB, vC, P;

	while(cin >> vA.first >> vA.second >> vB.first >> vB.second >> vC.first >> vC.second >> P.first >> P.second){
		if(checkTriIn(vA, vB, vC, P)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}
}

C++: #include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>
 
using namespace std;
 
#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)
 
typedef vector<int> vi;
 
int main()
{
    double x1, y1, x2, y2, x3, y3, xp, yp;
    while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF){
        double a1 = (xp-x1)*(y2-y1)-(yp-y1)*(x2-x1);
        bool parity = a1 > 0.0;
 
        double a2 = (xp-x2)*(y3-y2)-(yp-y2)*(x3-x2);
        if(parity ^ (a2 > 0.0)){
            puts("NO");
            continue;
        }
 
        double a3 = (xp-x3)*(y1-y3)-(yp-y3)*(x1-x3);
        puts(parity^(a3>0.0) ? "NO" : "YES");
    }
    return 0;
}