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>

using namespace std;

typedef double d;

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

int main ( void )
{
  d x[3], y[3], xp, yp;
  
  while( cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp )
  {
     d ret[3];
     for ( int i = 0; i < 3; ++i )
     {
        int nx = (i + 1) % 3;
        ret[i] = cross(xp - x[i], yp - y[i], x[nx] - x[i], y[nx] - y[i]);
     }
     if ( (ret[0] < 0 && ret[1] < 0 && ret[2] < 0) ||
          (ret[0] > 0 && ret[1] > 0 && ret[2] > 0) )
     {
        cout << "YES" << endl;
     }
     else
     {
        cout << "NO" << endl;
     }
  }
  return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <complex>
#define rep(i,n) for(int i=0; i<(n); i++)
#define EPS 1e-10
using namespace std;

typedef complex<double> cd;

double s(cd a, cd b){
  return abs(a.real()*b.imag()-a.imag()*b.imag());
}

int main(){
  cd a[4];

  for(;;){
    rep(i,4){
      double x,y;
      if(!~scanf(" %lf %lf", &x,&y))
        return 0;
      a[i]=cd(x,y);
    }
    
    if( abs(
            s(a[0]-a[3], a[1]-a[3])
            + s(a[1]-a[3], a[2]-a[3])
            + s(a[2]-a[3], a[1]-a[3])
            - s(a[0]-a[1],a[1]-a[2]) < EPS))
      printf("IN\n");
    else
      printf("OUT\n");
  }
  rep(i,4)
    printf("%lf %lf ", a[i].real(), a[i].imag());
  printf("\n");
  
  return 0;
}

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

class Point{
    public:
    double x;
    double y;
};

 double vecProduct(Point p1, Point p2, Point p3)
{
    return ((p1.x - p3.x)*(p2.y - p3.y) - (p2.x - p3.x)*(p1.y - p3.y));
}
    
bool isPointInTriangle(Point pt, Point v1, Point v2, Point v3)
{
    
    bool r1 = vecProduct(pt,v1,v2) < 0.0;
    bool r2 = vecProduct(pt,v2,v3) < 0.0;
    bool r3 = vecProduct(pt,v3,v1) < 0.0;
    
    return ((r1 == r2) && (r2 == r3));
}

int main(void){
   Point p1,p2,p3,pt;
   
   while(cin>>p1.x>>p1.y>>p2.x>>p2.y>>p3.x>>p3.y>>pt.x>>pt.y)
   {
        if(isPointInTriangle(pt,p1,p2,p3))
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
   }
}

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

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

	while(!cin.eof()) {
		bool l, r;
		l = r = false;
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py;
		x[3] = x[0];
		y[3] = y[0];

		for(int i = 0; i < 3; i++) {
			if(x[i]*py - y[i]*px < 0)
				r = true;
			else
				l = true;
		}

		cout << (r ^ l ? "NO" : "YES") << endl;
	}
	return 0;

}

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


int main(){
	
	double x1,x2,x3;
	double	y1,y2,y3;
	double xp,yp;
	double	A,B,C,a,b,c;
	
	while(cin>>x1){
		cin>>y1>>x2>>y2>>x3>>y3>>xp>>yp;
		
		A=pow(x1-x2,2)+pow(y1-y2,2);
		B=pow(x1-x3,2)+pow(y1-y3,2);
		C=pow(x2-x3,2)+pow(y2-y3,2);
		a=pow(xp-x1,2)+pow(yp-y1,2);
		b=pow(xp-x2,2)+pow(yp-y2,2);
		c=pow(xp-x3,2)+pow(yp-y3,2);
		
		if(a>A||a>B||a>C||b>A||b>B||b>C||c>A||c>B||c>C)
			cout<<"NO"<<endl;
		else
			cout<<"YES"<<endl;
	}
	
}

C++: #include <cstdio>
#include <algorithm>
#define LOOP(index,times) for(int index=0;index<times;index++)
using namespace std;

int main(){

float x[3],y[3],xp,yp;

while(scanf("%f %f %f %f %f %f %f %f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&xp,&yp) != EOF){

sort(x,x+3);
sort(y,y+3);

if(x[0] < xp && xp < x[2] && y[0] < yp && yp < y[2]){
	printf("YES\n");
}else{
	printf("NO\n");
}

}
return 0;		
}

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

bool is_inner(d a1,d a2,d b1,d b2,d c1,d c2) {
  if(((b1-a1)*(c2-b2)-(b2-a2)*(c1-b1)) >0) return true;
  return false;
}
int main() {
  d x1,y1,x2,y2,x3,y3,xp,yp;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    bool a,b,c;
    a = is_inner(x1,y1,x2,y2,xp,yp);
    b = is_inner(x2,y2,x3,y3,xp,yp);
    c = is_inner(x3,y3,x1,y1,xp,yp);
    if(a == b && b == c) cout << "YES" << endl;
    else cout << "NO" << endl;
  }
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

struct vector2D
{
	double x, y;

	vector2D(double x, double y)
	{
		this->x = x;
		this->y = y;
	}
};

vector2D vec(double ax, double ay, double bx, double by)
{
	return vector2D(bx - ax, by - ax);
}

double outer(vector2D a, vector2D b)
{
	return a.x * b.y - a.y * b.x;
}

int main()
{
	vector<double> x(3);
	vector<double> y(3);
	double xp, yp;
	for (;cin >> x.at(0) >> y.at(0) >> x.at(1) >> y.at(1) >> x.at(2) >> y.at(2) >> xp >> yp;)
	{
		vector2D ab = vec(x.at(1), y.at(1), x.at(0), y.at(0));
		vector2D bc = vec(x.at(2), y.at(2), x.at(1), y.at(1));
		vector2D ca = vec(x.at(0), y.at(0), x.at(2), y.at(2));

		vector2D ap = vec(xp, yp, x.at(0), y.at(0));
		vector2D bp = vec(xp, yp, x.at(1), y.at(1));
		vector2D cp = vec(xp, yp, x.at(2), y.at(2));


		if ((outer(ab, bp) >= 0 && outer(bc, cp) >= 0 && outer(ca, ap) >= 0) || (outer(ab, bp) <= 0 && outer(bc, cp) <= 0 && outer(ca, ap) <= 0))
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

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

int edinton(int i,int j, int k);
double cross(double *a,double *b);

int main(){
    double p[4][3],z[3];
    int sum=0;
    for(int l=0;l<4;l++){
        cin >> p[l][0] >> p[l][1];
        p[l][2]=0;
    }
    for(int i=0;i<3;i++){
        z[i]=cross(p[i],p[3]);
        z[i]=z[i]/fabs(z[i]);
        sum+=z[i];
    }
    if(sum==3) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

int edinton(int i,int j, int k){
    int a=1,b=2,c=3,d;
    for(int l=0;l<3;l++){
        if(i==a&&j==b&&k==c) return 1;
        d=c;c=b;b=a;a=d;
    }
    a=3; b=2; c=1;
    for(int l=0;l<3;l++){
        if(i==a&&j==b&&k==c) return -1;
        d=c;c=b;b=a;a=d;
    }
    return 0;
}
double cross(double *a,double *b){
    double c=0;
    for(int i=1;i<=3;i++)
        for(int j=1;j<=3;j++)
            for(int k=1;k<=3;k++){
                c+=edinton(i, j, k)*a[j]*b[k];
            }
    return c;
}