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 <bits/stdc++.h>
using namespace std;

typedef ostringstream OSS; typedef istringstream ISS;
typedef long long LL;
typedef pair<int, int> PII;  typedef pair<LL, LL> PLL;
typedef vector<int>    VI;   typedef vector<VI>   VVI;   typedef vector<VVI>   VVVI;
typedef vector<LL>     VLL;  typedef vector<VLL>  VVLL;  typedef vector<VVLL>  VVVLL;
typedef vector<double> VD;   typedef vector<VD>   VVD;   typedef vector<VVD>   VVVD;
typedef vector<string> VS;   typedef vector<VS>   VVS;   typedef vector<VVS>   VVVS;
typedef vector<bool>   VB;   typedef vector<VB>   VVB;   typedef vector<VVB>   VVVB;
typedef vector<PII>    VPII; typedef vector<VPII> VVPII; typedef vector<VVPII> VVVPII;
typedef vector<PLL>    VPLL; typedef vector<VPLL> VVPLL; typedef vector<VVPLL> VVVPLL;

typedef unsigned int  UI;
typedef vector<UI>    VUI;
typedef vector<VUI>   VVUI;

#define fst first
#define snd second
// #define Y first
// #define X second
#define MP make_pair
#define PB push_back
#define EB emplace_back 
#define ALL(x)  (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define RANGEBOX(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define RANGE(x, l, r) ((l) <= (x) && (x) <= (r))
#define rep(i, N)  for (int i = 0; i < (int)(N); i++)
#define rrep(i, N) for (int i = N - 1; i >= 0; i--)
#define REP(i, init, N)  for (int i = (init); i < (int)(N); i++)
#define RREP(i, N, last) for (int i = (init - 1); i >= last; i--)
#define MAXUD(orig, target) orig = max(orig, target)
#define MINUD(orig, target) orig = min(orig, target)
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

template < typename T > inline T fromString(const string &s) { T res; ISS iss(s); iss >> res; return res; };
template < typename T > inline string toString(const T &a)   { OSS oss; oss << a; return oss.str(); };

template<typename T=int> inline void dump(vector<T> vs, bool ent=false) { rep(i, vs.size()) cout << vs[i] << (i+1==vs.size() ? '\n' : ' '); if (ent) cout << endl; }
template<typename T = int> inline void dump(vector<vector<T>> vs, bool ent = false) { rep(i, vs.size()) dump<T>(vs[i]); if (ent) cout << endl; }

const int    INF  = 0x3f3f3f3f;
const LL     INFL = 0x3f3f3f3f3f3f3f3fLL;
const double DINF = 0x3f3f3f3f;
const int    DX[] = {1,  0, -1, 0};
const int    DY[] = {0, -1,  0, 1};
const double EPS  = 1e-12;
// const double PI   = acos(-1.0);
// lambda: [](T1 x)->T2{return y;}
// simple lambda: [](T x){return x;}

#define X real()
#define Y imag()

typedef complex<double> P;

// a <= b
bool le(double a, double b) {
    return a < b + EPS;
}

// a >= b
bool ge(double a, double b) {
    return a + EPS > b;
}

// a = b
bool eq(double a, double b) {
    return abs(a - b) < EPS;
}

// ?????¢
double distPP(P a, P b) {
    double x = a.X - b.X;
    double y = a.Y - b.Y;
    return sqrt(x * x + y * y);
}

// ??????????????¬???
double heron(double a, double b, double c) {
    double s = (a + b + c) / 2.;
    return sqrt(s * (s - a) * (s - b) * (s - c));
}

double heron(P a, P b, P c) {
    return heron(distPP(a, b), distPP(b, c), distPP(c, a));
}

// ????§???¢??¨??????????????????
bool inTriangle(P a, P b, P c, P p) {
    double s1 = heron(a, b, c);
    double s2 = heron(p, b, c) + heron(a, p, c) + heron(a, b, p);
    return eq(s1, s2);
}

int main(void) {
    double x1, y1, x2, y2, x3, y3, xp, yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        P a(x1, y1);
        P b(x2, y2);
        P c(x3, y3);
        P p(xp, yp);
        cout << (inTriangle(a, b, c, p) ? "YES" : "NO") << endl;
    }


    return 0;
}

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

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

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

		double l1_x = (y2 - y3);
		double l1_y = -(x2 - x3);
		double l1_c = -(y2 - y3)*x3 + y3;
		
		double l2_x = (y1 - y3);
		double l2_y = -(x1 - x3);
		double l2_c = -(y1 - y3)*x3 + y3;

		double l3_x = (y1 - y2);
		double l3_y = -(x1 - x2);
		double l3_c = -(y1 - y2)*x2 + y2;

		if (((l1_x * xp + l1_y * yp + l1_c)*l1_c >= 0 &&
			(l2_x * xp + l2_y * yp + l2_c)*l2_c >= 0 &&
			(l3_x * xp + l3_y * yp + l3_c)*l3_c >= 0) ||
			((l1_x * xp + l1_y * yp + l1_c)*l1_c <= 0 &&
			(l2_x * xp + l2_y * yp + l2_c)*l2_c <= 0 &&
			(l3_x * xp + l3_y * yp + l3_c)*l3_c <= 0))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

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

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

int main() {
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    P a(x1, y1), b(x2, y2), c(x3, y3), p(xp, yp);
    double d1 = cross(b - a, p - a);
    double d2 = cross(c - b, p - b);
    double d3 = cross(a - c, p - c);
    if (((d1 < 0) && (d2 < 0) && (d3 < 0)) || ((d1 > 0) && (d2 > 0) && (d3 > 0))) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}

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

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

int main(){
    double x[4],y[4];

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

        xy_t a(x[0],y[0]), b(x[1],y[1]), c(x[2],y[2]), p(x[3],y[3]);
        double pab=cross(a-p,b-p),pbc=cross(b-p,c-p),pca=cross(c-p,a-p);
        bool ok=(pab*pbc>0 && pbc*pca>0);
        cout<<(ok?"YES":"NO")<<"\n";
    }
}

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

int main()
{
        double x1,y1,x2,y2,x3,y3;
        double xp,yp;
        double xv1,yv1,xv2,yv2,xvp,yvp;
        double t,u;

        while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
                xv1 = x2 - x1;
                yv1 = y2 - y1;
                xv2 = x3 - x1;
                yv2 = y3 - y1;
                xvp = xp - x1;
                yvp = yp - y1;

                t = (xvp*yv2-yvp*xv2)/(xv1*yv2-xv2*yv1);
                u = (yvp*xv1-xvp*yv1)/(xv1*yv2-xv2*yv1);

                if(0.0 < t && 0.0 < u && 0.0 < t+u && t+u < 1.0){
                        cout << "YES" << endl;
                }else{
                        cout << "NO" << endl;
                }
        }

        return 0;
}