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;
int main() {
  float x1, y1, x2, y2, x3, y3, px, py;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> px >> py) {
  float d_x1, d_y1, d_x2, d_y2, d_x3, d_y3;
  d_x1 = (x1 - px) / abs(x1 - px);
  d_y1 = (y1 - py) / abs(y1 - py);
  d_x2 = (x2 - px) / abs(x2 - px);
  d_y2 = (y2 - py) / abs(y2 - py);
  d_x3 = (x3 - px) / abs(x3 - px);
  d_y3 = (y3 - py) / abs(y3 - py);
  if (abs(d_x1 + d_x2 + d_x3) < 3 && abs(d_y1 + d_y2 + d_y3) < 3) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  }
  return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
const double EPS = 1e-9;
const double PI  = acos(-1.0);

#include <complex>
typedef complex<double> P;

double cross(P a, P b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}
double dot(P a, P b) {
    return (a.real() * b.real() + a.imag() * b.imag());
}
int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;           // counter clockwise
  if (cross(b, c) < 0)   return -1;           // clockwise
  if (dot(b, c) < 0)     return +2;           // c--a--b on line
  if (norm(b) < norm(c)) return -2;           // a--b--c on line
  return 0;                                   // a--c--b on line
}
bool triangle_contains(const vector<P>& tri, const P& p) {
	if( ccw(tri[0], tri[1], p) > 0 &&
		ccw(tri[1], tri[2], p) > 0 &&
		ccw(tri[2], tri[0], p) > 0 )
		return true;
	if( ccw(tri[0], tri[1], p) < 0 &&
		ccw(tri[1], tri[2], p) < 0 &&
		ccw(tri[2], tri[0], p) < 0 )
		return true;
	return false;
}

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		vector<P> triangle;
		triangle.push_back(P(x1,y1));
		triangle.push_back(P(x2,y2));
		triangle.push_back(P(x3,y3));
		bool contains=triangle_contains(triangle,P(xp,yp));
		cout<<(contains?"YES":"NO")<<endl;
	}
}

C++: #include <iostream>
#include <cmath>
using namespace std;
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[4],y[4];
  while(cin >> x[0]>>y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3]){
  
    double A,B,C;
    A = sqrt(pow(x[0] - x[1],2)+pow(y[0] - y[1],2));
    B = sqrt(pow(x[0] - x[2],2)+pow(y[0] - y[2],2));
    C = sqrt(pow(x[2] - x[1],2)+pow(y[2] - y[1],2));

    double S1 = heron(A,B,C);

    double XA,XB,XC;
    XA = sqrt(pow(x[0] - x[3],2)+pow(y[0] - y[3],2));
    XB = sqrt(pow(x[1] - x[3],2)+pow(y[1] - y[3],2));
    XC = sqrt(pow(x[2] - x[3],2)+pow(y[2] - y[3],2));

    double S2 = heron(XA,XB,C) + heron(XA,XC,B) + heron(XB,XC,A);
    if((float)S1 == (float)S2)cout <<"YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

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

using namespace std;

double cross(complex<double> A, complex<double> B){
	return (conj(A)*B).imag();
}

int main(){
	while(true){
		complex<double> Point[3], P;
		double x,y;
		for(int i=0;i<3;i++){
			cin >> x >> y;
			Point[i]={x,y};
		}

		cin >> x >> y;
		P={x,y};

		if(!cin)
			break;

		int sum=0;
		for(int i=0;i<3;i++){
			sum += cross(Point[(i+1)%3]-Point[i], P-Point[i])>0;
		}
		cout << (sum==0||sum==3 ? "Yes":"No") << endl;
	}
	return 0;
}

C++: #include <iostream>

struct Vec2D{
				double x,y;
};

Vec2D vector(double x1,double y1,double x2,double y2){
				Vec2D vec;
				vec.x = x2 -x1;
				vec.y = y2 -y1;
				return vec;
}

double outerProduct(Vec2D a,Vec2D b){
				double crossProduct = a.x * b.y - a.y * b.x;
				return crossProduct;
}

int main(int argc, char *argv[])
{
	double x1,x2,x3,y1,y2,y3,x,y;

	while(std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y){

		Vec2D BA = vector(x2,y2,x1,y1);
		Vec2D CB = vector(x3,y3,x2,y2);
		Vec2D AC = vector(x1,y1,x3,y3);


		Vec2D BP = vector(x2,y2,x,y);
		Vec2D CP = vector(x3,y3,x,y);
		Vec2D AP = vector(x1,y1,x,y);

		double a,b,c;

		a = outerProduct(BA,BP);
		b = outerProduct(CB,CP);
		c = outerProduct(AC,AP);



		if(a<0 && b<0 && c<0){
					std::cout << "YES" << std::endl;
		}else{
					std::cout << "NO" << std::endl;
		}

	}
	return 0;
}

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

int fun(float a, float b, float c, float d, float e, float f)
{
    float u,v;
    v = (c*d-a*f)/(b*d-a*e);
    u = (c-b*v)/a;
    if (u>0&&v>0&&(u+v) <=1)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;
}

int main()
{
    float x1,y1,x2,y2,x3,y3,xp,yp;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
    {
        fun(x2-x1,x3-x1,xp-x1,y2-y1,y3-y1,yp-y1);
    }
   return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	double x[3],y[3],xp,yp,r,xmax,xmin,ymax,ymin;
	int sum;
	while(cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>xp>>yp){
		xmax=max(x[0],max(x[1],x[2]));
		ymax=max(y[0],max(y[1],y[2]));
		xmin=min(x[0],min(x[1],x[2]));
		ymin=min(y[0],min(x[1],x[2]));
		sum=0;
		if(x[0]-x[1]==0)
			;
		else{
			r=(y[0]-y[1])*(xp-x[0])/(x[0]-x[1])+y[0];
		if(yp<r&&r>=ymin&&r<=ymax)
			sum++;
		}
		if(x[0]-x[2]==0)
		;
		else{
		r=(y[0]-y[2])*(xp-x[0])/(x[0]-x[2])+y[0];
		if(yp<r&&r>=ymin&&r<=ymax)
			sum++;
		}
		if(x[2]-x[1]==0)
			;
		else{
		r=(y[2]-y[1])*(xp-x[2])/(x[2]-x[1])+y[2];
			if(yp<r&&r>=ymin&&r<=ymax)
			sum++;
		}
		if(sum==1)
		cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}