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 <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#define fi first
#define se second
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int main() {
	long double x1,y1,x2,y2,x3,y3,xp,yp,s1,s2,s3,S;
	int A,B,C,D;
	while(true){
		if (cin.eof())break; 
		cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp;
		S=(x3-x1)*(y2-y1)-(x2-x1)*(y3-y1);
		s1=(x1-xp)*(y2-yp)-(x2-xp)*(y1-yp);
		s2=(x2-xp)*(y3-yp)-(x3-xp)*(y2-yp);
		s3=(x3-xp)*(y1-yp)-(x1-xp)*(y3-yp);
		S=fabs(S);
		s1=fabs(s1);
		s2=fabs(s2);
		s3=fabs(s3);
		A=S*1000;
		B=s1*1000;
		C=s2*1000;
		D=s3*1000;
		if(A==B+C+D){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}	
}

C++: #include <bits/stdc++.h>
using namespace std;

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

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

using D = double;
using P = complex<D>;

const D EPS = 1e-10;
namespace std {
  bool operator < (const P& a, const P& b) {
    return a.X != b.X ? a.X < b.X : a.Y < b.Y;
  }
};

struct L : array<P, 2> {
  L () = default;
  L(const P& a, const P& b) {
    front() = a;
    back() = b;
  }
  P vec() const {
    return back() - front();
  }
};
D dot(const P& a, const P& b) {
  return (conj(a)*b).X;
}
D cross(const P& a, const P& b) {
  return (conj(a)*b).Y;
}
int ccw(P a, P b, P c) {
  b -= a;
  c -= a;
  if(cross(b, c) > 0) return +1; // ccw
  if(cross(b, c) < 0) return -1; // cw
  if(dot(b, c) < 0) return +2; // L c-a-b
  if(norm(b) < norm(c)) return -2; // L a-b-c
  return 0;
}

bool intersectLL(const L& l, const L& m) {
  return abs(cross(l.vec(), m.vec())) > EPS ||
    abs(cross(l[1] - l[0], m[0] - l[0])) < EPS;
}

vector<string> split(const string& s, char c = ' ') {
  stringstream ss(s);
  vector<string> ret;
  string t;
  while(getline(ss, t, c)) ret.push_back(t);
  return ret;
}
int main() {
  string s;
  while(getline(cin, s)) {
    auto v = split(s);
    vector<P> p(4);
    rep(i, 4) {
      D x, y;
      x = stof(v[i*2].c_str());
      y = stof(v[i*2+1].c_str());
      p[i] = {x, y};
    }
    if(ccw(p[0], p[1], p[2]) == -1) {
      swap(p[1], p[2]);
    }
    assert(ccw(p[0], p[1], p[2]) == 1);
    bool f = true;
    rep(i, 3) {
      int j = (i+1)%3;
      if(ccw(p[i], p[j], p[3]) != 1) f = false;
    }
    cout << (f? "YES" : "NO") << endl;
  }
  return 0;
}

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

using namespace std;

#define EPS 1e-10

double heron(double a,double b,double c){
      double s = (a + b + c) / 2;

      return sqrt(s * (s - a) * (s - b) * (s - c));
}

int main() {
    double x[3],y[3],xp,yp,a,b,c,d,e,f,sq,sqd,sqe,sqf;
    
    while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
        a = sqrt(pow((x[1] - x[0]),2) + pow((y[1] - y[0]),2));
        b = sqrt(pow((x[2] - x[0]),2) + pow((y[2] - y[0]),2));
        c = sqrt(pow((x[2] - x[1]),2) + pow((y[2] - y[1]),2));

        sq = heron (a,b,c);

        d = sqrt(pow((xp - x[0]),2) + pow((yp - y[0]),2));
        e = sqrt(pow((xp - x[1]),2) + pow((yp - y[1]),2));
        f = sqrt(pow((xp - x[2]),2) + pow((yp - y[2]),2));

        sqd = heron(e,a,d);
        sqe = heron(d,b,f);
        sqf = heron(f,c,e);


        cout << sq << endl << sqd + sqe + sqf<< endl;
        if(abs(sq - (sqd + sqe + sqf)) < EPS){
            cout << "YES" << endl;
            }
        else {
            cout << "NO" << endl;
        }
    }

    return 0;
}

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};

int main()
{
  double x1,y1,x2,y2,x3,y3,xp,yp;
  while( cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
  double s;
  double a,b,c;
  a =sqrt(pow(x1-x2,2)+pow(y1-y2,2));
  c =sqrt(pow(x1-x3,2)+pow(y1-y3,2));
  b =sqrt(pow(x2-x3,2)+pow(y2-y3,2));
  s =(a+b+c)/2;
  double abcS =sqrt(s*(s-a)*(s-b)*(s-c));
  double ap,bp,cp;
  ap =sqrt(pow(x1-xp,2)+pow(y1-yp,2));
  bp =sqrt(pow(x2-xp,2)+pow(y2-yp,2));
  cp =sqrt(pow(x3-xp,2)+pow(y3-yp,2));
  s =(ap+bp+a)/2;
  double abpS =sqrt(s*(s-ap)*(s-bp)*(s-a));
  s =(bp+cp+b)/2;
  double bpcS =sqrt(s*(s-bp)*(s-cp)*(s-b));
  s =(ap+cp+c)/2;
  double apcS =sqrt(s*(s-ap)*(s-cp)*(s-c));
  double var =abcS-(abpS+bpcS+apcS);
  if((var<=0.001&&var>=-0.01))
     var=0.0;
  if(var==0.0)
    cout <<"YES"<<endl;
  else
    cout <<"NO"<<endl;
  
  }
  return 0;
}

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

struct TPoint
{
    double x;
    double y;
    TPoint(){}
    TPoint(int X, int Y)
     : x(X), y(Y){}
};
struct TTriangle
{
    TPoint p1;
    TPoint p2;
    TPoint p3;
};
typedef TPoint TVector;
TVector Vector(const TPoint& A, const TPoint& B)
{
    return TVector(B.x - A.x, B.y - A.y);
    // return TVector(A.x - B.x, A.y - B.y);
}
double Cross(const TVector& A, const TVector& B)
{
    return A.x * B.y - B.x * A.y;
}

bool IsContain(const TTriangle& Tri, const TPoint& P)
{
    bool s1 = Cross(Vector(Tri.p1, Tri.p2), Vector(Tri.p1, P)) < 0;
    bool s2 = Cross(Vector(Tri.p2, Tri.p3), Vector(Tri.p2, P)) < 0;
    bool s3 = Cross(Vector(Tri.p3, Tri.p1), Vector(Tri.p3, P)) < 0;
    std::cout << s1 << s2 << s3 << std::endl;
    return s1 == s2 && s2 == s3;
}
int main()
{
    while(true){
        TTriangle Tri;
        TPoint P;
        std::cin >> Tri.p1.x >> Tri.p1.y >> Tri.p2.x >> Tri.p2.y >> Tri.p3.x >> Tri.p3.y >> P.x >> P.y;
        if(std::cin.eof()) break;
        std::cout << (IsContain(Tri, P) ? "YES" : "NO") << std::endl;
    }
    return 0;
}