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<math.h>
using namespace std;
struct vect{
  double x,y;
};
double leng(vect a,vect b){
  return sqrt((a.x - b.x)*(a.x - b.x)+(a.y - b.y)*(a.y - b.y));
    }
double Sc(vect a,vect b,vect c){
  double S,l1,l2,l3; 
  l1 = leng(a,b);
  l2 = leng(b,c);
  l3 = leng(c,a);
  S = (l1 + l2 + l3) / 2;
  return sqrt(S*(S-l1)*(S-l2)*(S-l3));
  
}

int main(){
  vect a,b,c,p;
  double s1,s2,s3,s;
  while(cin >> a.x >> a.y  >> b.x >> b.y >>c.x >>c.y >> p.x >> p.y){
    s1 = Sc(a,b,p); s2 = Sc(a,p,c); s3 = Sc(p,b,c); 
    s = Sc(a,b,c);
    if( Sc(a,b,p) + Sc(a,p,c) < Sc(a,b,c)&&Sc(p,b,c) + Sc(a,p,c) < Sc(a,b,c) && Sc(a,b,p) + Sc(p,b,c) < Sc(a,b,c) ){cout << "YES" << endl;
    }else {cout << "NO" << endl;}
    
  }
}

C++: #include <iostream>
#include <cmath>
#define eps 1e-9
using namespace std;
typedef struct
{
    double x;
    double y;
}Point;
double area(Point a,Point b,Point c)
{
    return a.x*b.y+c.x*a.y+b.x*c.y-c.x*b.y-a.x*c.y-b.x*a.y;
}
int main()
{
    Point a,b,c,tar;
    while(cin>>a.x>>a.y>>b.x>>b.y>>c.x>>c.y>>tar.x>>tar.y)
    {
        double sum=abs(area(a,b,c));
        double cmp=abs(area(a,b,tar))+abs(area(a,c,tar))+abs(area(b,c,tar));
        if(fabs(sum-cmp)<eps)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;
    }
    return 0;
}

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

struct TPoint
{
	double x;
	double y;
};

double GetCrossProduct(const TPoint& V1, const TPoint& V2)
{
	return V1.x * V2.y - V1.y * V2.x;
}

double Vector(const TPoint& P1, const TPoint& P2)
{
	return {P2.x - P1.x, P2.y - P1.y};
}

bool IsSameSide(const TPoint& P1, const TPoint& P2, const TPoint& L1, const TPoint& L2)
{
	return GetCrossProduct(Vector(L1, P1), Vector(L1, L2)) * GetCrossProduct(Vector(L1, P2), Vector(L1, L2)) > 0;
}

int main()
{
	while(true){
		TPoint A1, A2, A3, Ap;
		cin >> A1.x >> A1.y >> A2.x >> A2.y >> A3.x >> A3.y >> Ap.x >> Ap.y;
		if(cin.eof() == true) break;
		if(IsSameSide(A3, Ap, A1, A2) && IsSameSide(A1, Ap, A2, A3) && IsSameSide(A2, Ap, A3, A1)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

using namespace std;
typedef pair<double, double> P;

double CalcTriSquare(P p1, P p2, P p3)
{
	double a, b, c;
	double s;
	a = sqrt((p2.first - p1.first) * (p2.first - p1.first) + (p2.second - p1.second) * (p2.second - p1.second));
	b = sqrt((p3.first - p1.first) * (p3.first - p1.first) + (p3.second - p1.second) * (p3.second - p1.second));
	c = sqrt((p3.first - p2.first) * (p3.first - p2.first) + (p3.second - p2.second) * (p3.second - p2.second));
	s = (a + b + c) / 2;
	return(sqrt(s * (s - a) * (s - b) * (s - c)));
}

void solve()
{
	P p[4];
	while(cin >> p[0].first >>p[0].second >> p[1].first >> p[1].second >> p[2].first >> p[2].second >> p[3].first >> p[3].second)
	{
		double sum = 0;
		sum += CalcTriSquare(p[0], p[1], p[3]);
		sum += CalcTriSquare(p[0], p[2], p[3]);
		sum += CalcTriSquare(p[1], p[2], p[3]);
		double square = CalcTriSquare(p[0], p[1], p[2]);
		if(fabs(sum - square) < 0.001)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <assert.h>
using namespace std;
typedef  struct{
	double x,y;
}coord;

int main(){
	coord  vPolygon[3],pPoint;
	while(cin >> vPolygon[0].x >> vPolygon[0].y){
		for (int i=1;i<3;i++) cin >> vPolygon[i].x >> vPolygon[i].y;
		cin >> pPoint.x >> pPoint.y;
		int count= 0;
		for (int i=0;i<3;i++){
			if ( ((vPolygon[i%3].y <= pPoint.y)&&(pPoint.y < vPolygon[(i+1)%3].y))
				|| ((vPolygon[(i+1)%3].y <= pPoint.y)&&(pPoint.y < vPolygon[i%3].y)) ){
				double vt = (pPoint.y - vPolygon[i%3].y)/(vPolygon[(i+1)%3].y - vPolygon[i%3].y);
			if (pPoint.x < vPolygon[i%3].x + ( vt * ( vPolygon[(i+1)%3].x - vPolygon[i%3].x) )){
				++count;
			}
		}
	}
	cout << ((count&1)?"YES":"NO") << endl;
}
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

double cross (double x1, double y1, double x2, double y2 )
{
	return (x1*y2 - x2*y1 );
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.APT", "r", stdin );
	string str = "";
	while (getline (cin, str ) && !str.empty() ){
		stringstream ss (str );
		double x1, y1, x2, y2, x3, y3, xp, yp;
		ss >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
		double c1 = cross (xp - x1, yp - y1 , x2 - x1, y2 - y1 );
		double c2 = cross (xp - x2, yp - y2 , x3 - x2, y3 - y2 );
		double c3 = cross (xp - x3, yp - y3 , x1 - x3, y1 - y3 );
		if ((c1 > 0. && c2 > 0. && c3 > 0. ) || (c1 < 0. && c2 < 0. && c3 < 0. ) ){
			printf ("YES\n" );
		}else{
			printf ("NO\n" );
		} // end if
	} // end while

	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
    double x[3],y[3],px,py;
    while(cin>>x[0]>>y[0]){
        for(int i=1;i<3;i++)cin>>x[i]>>y[i];
        cin>>px>>py;
        bool ok=true;
        for(int i=0;i<3;i++){
            bool plus=false;
            if(x[(i+1)%3]==x[(i+2)%3]){
                if(x[i]>x[(i+1)%3])plus=true;
            }
            else{
                double a,b;
                a=(x[i]-x[(i+1)%3])*(y[(i+2)%3]-y[(i+1)%3]);
                b=(y[i]-y[(i+1)%3])*(x[(i+2)%3]-x[(i+1)%3]);
                if(a>b)plus=true;
            }
            bool pnt=false;
            if(x[(i+1)%3]==x[(i+2)%3]){
                if(px>x[(i+1)%3])pnt=true;
            }
            else{
                double a,b;
                a=(px-x[(i+1)%3])*(y[(i+2)%3]-y[(i+1)%3]);
                b=(py-y[(i+1)%3])*(x[(i+2)%3]-x[(i+1)%3]);
                if(a>b)pnt=true;
            }
            if(pnt!=plus)ok=false;
        }
        if(ok)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}