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;

class Vector2{
public:
	Vector2(){}
	Vector2( double aX, double aY ) : x( aX ), y( aY ){}

	double dot( Vector2& a ){
		return ( x * a.x ) + ( y * a.y );
	}

	double x;
	double y;
};


int main(){
	Vector2 p0, p1, p2, q;

	while ( cin >> p0.x >> p0.y >> p1.x >> p1.y >> p2.x >> p2.y >> q.x >> q.y ){
		bool isInner = false;
		Vector2 a( p1.x - p0.x, p1.y - p0.y );
		Vector2 b( p2.x - p0.x, p2.y - p0.y );
		Vector2 c( q.x - p0.x, q.y - p0.y );

		double aa = a.dot( a );
		double ab = a.dot( b );
		double ac = a.dot( c );
		double bb = b.dot( b );
		double bc = b.dot( c );

		double s = ( bc*ab - ac*bb ) / ( ab*ab - aa*bb );
		if ( ( s > 0.0 ) && ( s < 1.0 ) ){
			double t = ( ac*ab - bc*aa ) / ( ab*ab - aa*bb );
			if ( ( t > 0.0 ) && ( s + t < 1.0 ) ){
				isInner = true;
			}
		}

		cout << ( isInner ? "Yes" : "No" ) << endl;
	}


	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main (int argc, char * const argv[]) {
    // insert code here...
    double x1, y1, x2, y2, x3, y3, xp, yp;
	
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		/*
		if( ((x1-x2)*yp-xp*(y1-y2))>0 && ((x2-x3)*yp-xp*(y2-y3))>0 && ((x3-x1)*yp-xp*(y3-y1))>0 ){
			cout<<"YES"<<endl;
		}else if( ((x1-x2)*yp-xp*(y1-y2))<0 && ((x2-x3)*yp-xp*(y2-y3))<0 && ((x3-x1)*yp-xp*(y3-y1))<0 ){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
		*/
		
		if( (x2-x1)*(yp-y1)-(y2-y1)*(xp-x1) >0 && (x3-x2)*(yp-y2)-(y3-y2)*(xp-x2) >0 && (x1-x3)*(yp-y3)-(y1-y3)*(xp-x3) >0 ){
			cout << "YES" << endl;
		}else if( (x2-x1)*(yp-y1)-(y2-y1)*(xp-x1) <0 && (x3-x2)*(yp-y2)-(y3-y2)*(xp-x2) <0 && (x1-x3)*(yp-y3)-(y1-y3)*(xp-x3) <0 ){
			cout << "YES" << endl;
		}else{
			cout <<"NO" <<endl;
		}
	}
	return 0;
}

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

double helon(double x1,double y1,double x2,double y2,double x3,double y3){
	double a,b,c,s,area;
	a = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
	b = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
	c = sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
	s = (a+b+c)/2;
	area = sqrt(s*(s-a)*(s-b)*(s-c));
	return area;
}

int main(){
	double e=0.0000001;
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		double s,s1,s2,s3;
		s = helon(x1,y1,x2,y2,x3,y3);
		s1 = helon(xp,yp,x1,y1,x2,y2);
		s2 = helon(xp,yp,x2,y2,x3,y3);
		s3 = helon(xp,yp,x3,y3,x1,y1);
		//cout<<s<<" "<<s1<<" "<<s2<<" "<<s3<<endl;
		if(s1==0 || s2==0 || s3==0)
			cout<<"NO"<<endl;
		else if(abs(s-(s1+s2+s3))<e)
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
		
	}
	return 0;
}

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

double wn_angle(int x, int y)
{
  double r = acos(x / sqrt(x * x + y * y));
  // y????????????????¬¬3, 4?±????
  if(y < 0)
    r = PI * 2 - r;
  return y < 0 ? PI * 2 - r : r;
}

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 = wn_angle(xx, yy);
  double s = 0;
  for(int i = 0; i < n; i++)
  {
    int xx = p[i][0] - x, yy = p[i][1] - y;
    double r2 = wn_angle(xx, yy);
    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) ? "YES" : "NO ") << endl;;
  }
}

C++: #include <iostream>

/// check if (x1, y1) <-> (x2, y2) and (x3, y3) <-> (x4, y4) is crossed.
bool is_cross(double x1, double y1, double x2, double y2,
              double x3, double y3, double x4, double y4)
{
  if (((x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)) *
      ((x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)) > 0) {
    return false;
  } else {
    return true;
  }
}

int main()
{
  double x1, y1, x2, y2, x3, y3, xp, yp, center_x, center_y;
  while (std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    center_x = (x1 + x2 + x3) / 3.0;
    center_y = (y1 + y2 + y3) / 3.0;
    if (is_cross(x1, y1, x2, y2, xp, yp, center_x, center_y) ||
        is_cross(x1, y1, x3, y3, xp, yp, center_x, center_y) ||
        is_cross(x2, y2, x3, y3, xp, yp, center_x, center_y)) {
      std::cout << "NO" << std::endl;
    } else {
      std::cout << "YES" << std::endl;
    }
  }
  return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;
 
#define rep(i,n) for(int i=0;i<int(n);++i)
 
static const double PI=6*asin(0.5);
typedef complex<double> P;
typedef long long ll;
static const double eps = 1e-8;
 
double x[3],y[3];
double xp,yp;
 
double dist(P a,P b){
    return (sqrt((real(a)-real(b))*(real(a)-real(b))+(imag(a)-imag(b))*(imag(a)-imag(b))));
}
 
double tri_pro(P a,P b,P c){
    double aa,bb,cc;
    aa = dist(b,c);
    bb = dist(c,a);
    cc = dist(a,b);
    double s = (aa+bb+cc)/2.0;
    return sqrt(s*(s-aa)*(s-bb)*(s-cc));
}
 
 
int main(){
    //P a(0.0,0.0),b(4.0,0.0),c(4.0,2.0);
    //cout<<tri_pro(a,b,c)<<endl;
    
    
    
    while(cin>>x[0]>>y[0]){
        rep(i,2) cin>>x[i+1]>>y[i+1];
        cin>>xp>>yp;
        P a(x[0],y[0]),b(x[1],y[1]),c(x[2],y[2]);
        P p(xp,yp);
        double sa,sb,sc;
        sa = tri_pro(b,c,p);
        sb = tri_pro(c,a,p);
        sc = tri_pro(a,b,p);
        double s = tri_pro(a,b,c);
        //cout<<"s="<<s<<"\nsa sb sc "<<sa<<" "<<sb<<" "<<sc<<endl;
        if((int)(s*100)-(int)((sa+sb+sc)*100)==0) cout<<"YES\n";
        else cout<<"NO\n";
    }
    
    return 0;
}

C++: #include <cstdio>
#include <bitset>
#include <cmath>
#include <complex>
#include <vector>
#include <algorithm>

#define EPS 1e-6

using namespace std;
typedef complex<double> coor;

double cross(coor a, coor b)
{
  return a.real() * b.imag() - a.imag() * b.real();
}

double dot(coor a, coor b)
{
  return a.real() * b.real() + a.imag() * b.imag();
}

int main()
{
  double _x[3][2], _p[2];
  while (scanf(" %lf %lf %lf %lf %lf %lf %lf %lf ", &_x[0][0], &_x[0][1], &_x[1][0], &_x[1][1], &_x[2][0], &_x[2][1], &_p[0], &_p[1]) == 8) {
    coor x[3], g(0, 0);
    for (int i = 0; i < 3; i++) {
      x[i] = coor(_x[i][0], _x[i][1]);
      g += x[i];
    }
    g /= 3;
    coor p = coor(_p[0], _p[1]);
    coor d;
    for (int i = 0; i < 3; i++) {
      d = x[(i + 1) % 3] - x[i];
      if ((dot(d * coor(0, 1), g) - dot(d * coor(0, 1), x[i])) * (dot(d * coor(0, 1), p) - dot(d * coor(0, 1), x[i])) < 0) {
	printf("NO\n");
	goto next;
      }
    }
    printf("YES\n");
  next:;
  }
}