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 <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

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

int ccw(double x1,double y1,double x2,double y2,double x3,double y3)
{
	return cross(x2-x1,y2-y1,x3-x1,y3-y1)>0;
}

int main()
{
	//float x,y,a,b,n,m,p,q;
	//int i;
	//for(;~scanf("%f%f%f%f%f%f%f%f",&x,&y,&a,&b,&n,&m,&p,&q);puts(i>2^!i?"YES":"NO"))
	//	i=((p-x)*(b-y)>(q-y)*(a-x))+((p-a)*(m-b)>(q-b)*(n-a))+((p-n)*(y-m)>(q-m)*(x-n));
	
	for(double x,y,a,b,n,m,p,q;scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x,&y,&a,&b,&n,&m,&p,&q)==8;){
		int counter=0;
		//counter+=(p-x)*(b-y)-(q-y)*(a-x)>0;
		//counter+=(p-a)*(m-b)-(q-b)*(n-a)>0;
		//counter+=(p-n)*(y-m)-(q-m)*(x-n)>0;
		counter+=cross(a-x,b-y,p-x,q-y)>0;
		counter+=cross(n-a,m-b,p-a,q-b)>0;
		counter+=cross(x-n,y-m,p-n,q-m)>0;
		
		cout<<(counter%3==0?"YES":"NO")<<endl;
	}
	
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
double h(double x1,double y1,double x2,double y2,double px,double py){
	  double ax, ay, bx, by;
	  ax = x2 - x1;
	  ay = y2 - y1;
	  bx = px - x1;
	  by = py - y1;
	  return ax*by-ay*bx;
}
int main()
{
	double x1,x2,x3,y1,y2,y3,xp,yp,a,b,c;
	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
		a=h(x1,y1,x2,y2,xp,yp);
		b=h(x2,y2,x3,y3,xp,yp);
		c=h(x3,y3,x1,y1,xp,yp);
		if((a>0&&b>0&&c>0)||(a<0&&b<0&&c<0)){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}

	return 0;
}

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.000000001) cout << "YES" << endl;
    else cout << "NO" << endl;

}

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

int main()
{
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    if(y1 < y2){
      swap(x1, x2);
      swap(y1, y2);
    }
    if(y1 < y3){
      swap(x1, x3);
      swap(y1, y3);
    }
    
    if(((x2 - x1 != 0) ? (yp < (y2 -y1) / (x2 - x1) * (xp - x1) + y1) : (0 < (y2 - y1) * (xp - x1))) && ((x3 - x1 != 0) ? (yp < (y3 -y1) / (x3 - x1) * (xp - x1) + y1) : (0 < (y3 - y1) * (xp - x1))) && ((x2 - x3 != 0) ? (yp > (y2 -y3) / (x2 - x3) * (xp - x3) + y3) : (0 < (y2 - y3) * (xp - x3)))){
	cout << "YES" << endl;
      }else{
      cout << "NO" << endl;
    }
  }
}

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

double outer_product_z(double X[], double Y[]){
	return X[0]*Y[1]-X[1]*Y[0];
}
double x[4], y[4];
int main(){
	while(1){
		for(int i=0;i<4;i++){
			cin >> x[i] >> y[i];
		}
		double vec_ap[2] = {(x[3]-x[0]),(y[3]-y[0])};
		double vec_bp[2] = {(x[3]-x[1]),(y[3]-y[1])};
		double vec_cp[2] = {(x[3]-x[2]),(y[3]-y[2])};
		double vec_ab[2] = {(x[1]-x[0]),(y[1]-y[0])};
		double vec_bc[2] = {(x[2]-x[1]),(y[2]-y[1])};
		double vec_ca[2] = {(x[0]-x[2]),(y[0]-y[2])};

		if((outer_product_z(vec_ap,vec_ab)>0&&outer_product_z(vec_bp,vec_bc)>0&&outer_product_z(vec_cp,vec_ca)>0) || (outer_product_z(vec_ap,vec_ab)<0&&outer_product_z(vec_bp,vec_bc)<0&&outer_product_z(vec_cp,vec_ca)<0)) cout << "Yes" << endl;
		else cout << "No" << endl;

		if(cin.eof()) return 0;	
	}

}

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

double x1, y1, x2, y2, x3, y3, xp, yp;

int side(double p1_x, double p1_y, double p2_x, double p2_y){
	double n = xp*(p1_y - p2_y) + p1_x*(p2_y - yp) + p2_x*(yp - p1_y);
	if(n > 0) return 1; // left
	else if(n < 0) return -1; //right
	else return 0; //on_line
}

bool judge_in(){
	cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
	int pab = side(x1,y1,x2,y2);
	int pbc = side(x2,y2,x3,y3);
	int pca = side(x3,y3,x1,y1);

	if((pab > 0) && (pbc > 0) && (pca > 0)) return true;
	if((pab < 0) && (pbc < 0) && (pca < 0)) return true;
	return false;
}


int main(){
	bool judge = judge_in();
	if(judge == true) cout << "YES" << endl;
	else if(judge == false) cout << "NO" << endl;
}

C++: #include<cmath>
#include<iostream>
using namespace std;
#define PI 3.141592
int winding_number(int x, int y, double p[][2], int n)
{
  int xx = p[n - 1][0] - x, yy = y - p[n - 1][1] - y;
  double r1 = acos(xx / sqrt(xx * xx + yy * yy)); 
  double s = 0;
  for(int i = 0; i < n; i++)
  {
    int xx = p[i][0] - x, yy = p[i][1] - y;
    double r2 = acos(xx / sqrt(xx * xx + yy * yy));
    // y????????????????¬¬3, 4?±????
    if(yy < 0)
      r2 = PI * 2 - r2;
    double ts = r2 - r1;
    // 180???????????§?????????????????¨?????????
    if(abs(ts) > PI)
      ts = ts / abs(ts) * (PI - abs(ts));
    s += ts ;
    r1 = r2;
  }
  return abs(s) < PI ? 0 : 1;
}


double p[3][2];
int main()
{
  while(cin >> p[0][0] >> p[0][1] >> p[1][0] >> p[1][1] >> p[2][0] >> p[2][1])
  {
    double x, y;
    cin >> x >> y;
    cout << winding_number(x, y, p, 3) << endl;;
  }
}