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 <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string.h>
#include <bitset>
#include <queue>
#include <map>
#include <string>
#include <stack>
#include <utility>
#include <queue>
#include <cmath>
#define mp make_pair
#define pii pair<long long int,long long int> 
#define ff first
#define pb push_back
#define ss second
#define ll long long 
#define ull unsigned long long
#define vi vector<long long int>
#define vii vector<pii>
#define vvi vector <vi>
#define rep(x,a,b,c) for(int x=a;x<=b;x+=c)
#define repp(x,a,b) rep(x,a,b,1)
#define rev(x,a,b,c) for(int x=a;x>=b;x-=c)
#define revv(x,a,b) rev(x,a,b,1)
#define OO (int)2e9
#define INF (ll)1e18
#define EPS (double)1e-5
 
using namespace std;

double x[5],y[5],xx,yy,a,b,c,d,e,f,s,s1,s2,s3,aa,a1,a2,a3;

int main()
{
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&xx,&yy)!=EOF)
	{
		a=sqrt((x[2]-x[1])*(x[2]-x[1])+(y[2]-y[1])*(y[2]-y[1]));
		b=sqrt((x[2]-x[3])*(x[2]-x[3])+(y[2]-y[3])*(y[2]-y[3]));
		c=sqrt((x[3]-x[1])*(x[3]-x[1])+(y[3]-y[1])*(y[3]-y[1]));
		d=sqrt((xx-x[1])*(xx-x[1])+(yy-y[1])*(yy-y[1]));
		e=sqrt((xx-x[2])*(xx-x[2])+(yy-y[2])*(yy-y[2]));
		f=sqrt((xx-x[3])*(xx-x[3])+(yy-y[3])*(yy-y[3]));
		s=(a+b+c)/(double)2;
		s1=(a+d+e)/(double)2;
		s2=(b+e+f)/(double)2;
		s3=(c+d+f)/(double)2;
		aa=sqrt(s*(s-a)*(s-b)*(s-c));
		a1=sqrt(s1*(s1-a)*(s1-d)*(s1-e));
		a2=sqrt(s2*(s2-b)*(s2-e)*(s2-f));
		a3=sqrt(s3*(s3-c)*(s3-d)*(s3-f));
		if(abs(aa-a1-a2-a3)<=0.0001)
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}

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

using xy_t = std::complex<double>;

// Calculate the signed area of a rectungle
double cross_product(xy_t a, xy_t b);
// is point p inside of abc
bool isInsideTriangle(xy_t a, xy_t b, xy_t c, xy_t p);

int main()
{
  double x[4], y[4]; // 4 points in plane
  while (true)
  {
    for (size_t i {}; i < 4; ++i)
      std::cin >> x[i] >> y[i];
    if (!std::cin)
      break;
    xy_t a {x[0], y[0]}, b {x[1], y[1]}, c {x[2], y[2]}, p {x[3], y[3]};
    std::cout << (isInsideTriangle(a, b, c, p) ? "YES" : "NO") << std::endl;
  }
}

double cross_product(xy_t a, xy_t b)
{
  return (std::conj(a) * b).imag();
}

bool isInsideTriangle(xy_t a, xy_t b, xy_t c, xy_t p)
{
  double area[3];
  area[0] = cross_product(a - p, b - p);
  area[1] = cross_product(b - p, c - p);
  area[2] = cross_product(c - p, a - p);
  if ((area[0] > 0 && area[1] > 0 && area[2] > 0)
      || (area[0] < 0 && area[1] < 0 && area[2] < 0))
    return true;
  else 
    return false;
}

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

typedef struct myvector{
  double x;
  double y;
}Vector;

Vector sub_vector(Vector& a, Vector& b)
{
  Vector ret;
  ret.x = b.x - a.x;
  ret.y = b.y - a.y;
  return ret;
}

double cross_product(Vector& a, Vector& b)
{
  return a.x * b.y - b.x * a.y;
}

int main()
{
  Vector A, B, C, P;
  while(cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y >> P.x >> P.y){
    Vector AC = sub_vector(A, C);
    Vector CB = sub_vector(C, B);
    Vector BA = sub_vector(B, A);
    Vector AP = sub_vector(A, P);
    Vector CP = sub_vector(C, P);
    Vector BP = sub_vector(B, P);
    if((cross_product(AP, AC) > 0 && cross_product(CP, CB) > 0 && cross_product(BP, BA)) || (cross_product(AP, AC) < 0 && cross_product(CP, CB) < 0 && cross_product(BP, BA) < 0))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;    
  }
}

C++: #include<bits\stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

double dist(double x1, double y1, double x2, double y2){
    return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}

double triangleArea(double x, double y, double z){
    return (y * z * sin( acos( (y * y +  z * z - x * x) / (2 * y * z) ) )) / 2;
}

double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
    double x, y ,z;
    x = dist(x1, y1, x2, y2);
    y = dist(x2, y2, x3, y3);
    z = dist(x3, y3, x1, y1);
    return triangleArea(x, y, z);
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    double allArea, area12, area23, area31;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
    allArea = inputXY(x1, y1, x2, y2, x3, y3);
    area12 = inputXY(xp, yp, x2, y2, x1, y1);
    area23 = inputXY(x2, y2, x3, y3, xp, yp);
    area31 = inputXY(x3, y3, x1, y1, xp, yp);

    if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
    else cout << "NO" << endl;

}

C++: #include <iostream>
#include <cstdlib>
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 sall = (x1-x2)*(y1+y2) + (x2-x3)*(y2+y3) + (x3-x1)*(y3+y1);
		double s1 = (x1-x2)*(y1+y2) + (x2-xp)*(y2+yp) + (xp-x1)*(yp+y1);
		double s2 = (x1-xp)*(y1+yp) + (xp-x3)*(yp+y3) + (x3-x1)*(y3+y1);
		double s3 = (xp-x2)*(yp+y2) + (x2-x3)*(y2+y3) + (x3-xp)*(y3+yp);
		if(fabs(sall) == fabs(s1)+fabs(s2)+fabs(s3)){
			cout<<"YES"<<endl;
		} else {
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

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

typedef complex<double> P;
#define X real()
#define Y imag()

#define PI 3.14159265358979

double exterior_product(P p1, P p2, P p3){
        double vx2 = p2.X - p1.X;
        double vy2 = p2.Y - p1.Y;
        double vx3 = p3.X - p1.X;
        double vy3 = p3.Y - p1.Y;
        return vx2*vy3 - vx3*vy2;
}

int main(){
    double x1, x2, x3;
    double y1, y2, y3;
    double 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);

        double ex_1 = exterior_product(a, b, p);
        double ex_2 = exterior_product(c, a, p);
        double ex_3 = exterior_product(b, c, p);

        if(ex_1 > 0 && ex_2 > 0 && ex_3 > 0){
            cout << "YES" << endl;
        }
        else if(ex_1 < 0 && ex_2 < 0 && ex_3 < 0){
            cout << "YES" << endl;
        }
        else{
            cout << "NO" << endl;
        }
    }
    return 0;
}