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<algorithm>
#include<cstdio>

using namespace std;

float hang(float a,float b,float c,float d,float e,float f){
    float A;
    A=(a*d + b*e + c*f - e*d - b*c - a*f)/2;
    if(A<0)A=-A;
    return A;      
}

int main()
{
    float x1,y1,x2,y2,x3,y3,xp,yp,s1,s2,s3,s;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
       s1=hang(xp,yp,x2,y2,x3,y3);
       s2=hang(x1,y1,xp,yp,x3,y3);
       s3=hang(x1,y1,x2,y2,xp,yp);
       s=hang(x1,y1,x2,y2,x3,y3);
       if(s==(s1+s2+s3))cout<<"YES";
       else cout<<"NO";                                                   
    }
    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(1){
		complex<double> Point[3], P;
		double x,y;
		for(int i=0;i<3;i++){
			if(!(cin>>x>>y))
				return 0;
			Point[i]={x,y};
		}
		cin >> x >> y;
		P={x,y};

		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 <stdio.h>
double root(double a1, double b1, double a2, double b2, double a3, double b3) {double S=a1*b2+a2*b3+a3*b1-b1*a2-b2*a3-b3*a1;if (S<0) return -S; else return S;}
int main() {
    double x1,x2,x3,xp,y1,y2,y3,yp;while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF) {
    double s=root(x1,y1,x2,y2,x3,y3),s1=root(x1,y1,x2,y2,xp,yp),s2=root(x1,y1,xp,yp,x3,y3),s3=root(xp,yp,x2,y2,x3,y3);
    if (s==s1+s2+s3) puts("YES"); else puts("NO");} return 0;}

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

typedef complex<double> cd;

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

int main(){
  cd a[4];
  double x1, y1, x2, y2, x3, y3, xp, yp;

  while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)!=EOF){
    a[0] = cd(x1,y1);
    a[1] = cd(x2,y2);
    a[2] = cd(x3,y3);
    a[3] = cd(xp,yp);
    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[0]-a[3])
           - s(a[1]-a[0], a[2]-a[0])) < EPS )
      printf("IN\n");
    else
      printf("OUT\n");
  }
  
  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main() {
	double x[3], y[3], p, q;
	while (cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>p>>q) {
		bool f = true;
		for (int i = 0; i < 3; i++) {
			if ((x[i % 3] - p)*(y[(i + 1) % 3] - q) - (y[i % 3] - q)*(x[(i + 1) % 3] - p) <= 0)f = false;
		}
		if (f)puts("YES");
		else puts("NO");
	}
	return 0;
}

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

#define rep(i,n) for(int i=0; i<n; i++)
#define swap(a,b) tmp=ver[b], ver[b]=ver[a], ver[a]=tmp;
int main(){
	double x1, y1, x2, y2, x3, y3, xp, yp;
	double p, q, r;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		p=(x2-x1)*(yp-x1)-(y2-y1)*(xp-x1);
		q=(x3-x2)*(yp-x2)-(y3-y2)*(xp-x2);
		r=(x1-x3)*(yp-x3)-(y1-y3)*(xp-x3);
		if(p*q>0 && q*r>0 && r*p>0){
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<iomanip>
using namespace std;
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)

class Point{
	public:
		double x, y;

		Point(double x = 0, double y = 0): x(x), y(y) {}

		Point operator + (Point p){ return Point(x + p.x, y + p.y);}
		Point operator - (Point p){ return Point(x - p.x, y - p.y);}
		Point operator * (double a){ return Point(a * x, a * y);}
		Point operator / (double a){ return Point(x / a, y / a);}

		double abs(){ return sqrt(norm());}
		double norm(){ return x * x + y * y;}

		bool operator < (const Point &p) const{
			return x != p.x ? x < p.x : y < p.y;
		}

		bool operator == (const Point &p) const{
			return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
		}
};

struct Segment {
	Point p1, p2;
};
typedef Segment Line;

class Circle{
	public:
		Point c;
		double r;
		Circle(Point c = Point(), double r = 0.0): c(c), r(r) {}
};

typedef Point Vector;
typedef vector<Point> Polygon;

double dot(Vector a, Vector b){
	return a.x * b.x + a.y * b.y;
}
double cross(Vector a, Vector b){
	return a.x * b.y - a.y * b.x;
}

int contains(Polygon g, Point p){
	int n = g.size();
	bool x = false;
	for(int i = 0; i < n; i++){
		Point a = g[i] - p, b = g[(i + 1) % n] - p;
		if(abs(cross(a, b)) < EPS && dot(a, b) < EPS) return 1;
		if(a.y > b.y) swap(a, b);
		if(a.y < EPS && EPS < b.y && cross(a, b) > EPS) x = !x;
	}
	return (x ? 2 : 0);
}

int main(){
	int n;
	Polygon g(3); Point p;
	for(;;){
		if(!(cin >> g[0].x)) break;
		cin >> g[0].y;
		for(int i = 1; i < 3; i++){
			cin >> g[i].x >> g[i].y;
		}
		cin >> p.x >> p.y;
		if(contains(g, p) == 2) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int isintersecter(double x1,double y1,double x2,double y2,double px,double py,
		  double qx,double qy){
  if(((py-y1)*(x1-x2)-(y1-y2)*(px-x1))*((qy-y1)*(x1-x2)-(y1-y2)*(qx-x1)) < 0)return 1;
  else return 0;
}
int main(){
  double x1,y1,x2,y2,x3,y3,xp,xy;
  while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>xy)
    {
      if(isintersecter(x1,y1,x2,y2,x3,y3,xp,xy) || 
	 isintersecter(x2,y2,x3,y3,x1,y1,xp,xy) || 
	 isintersecter(x1,y1,x3,y3,x2,y2,xp,xy) )cout << "NO" << endl;
      else cout << "YES" << endl;
    }
}

C++: #include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  double a[3],b[3],c,d,e,f,x,y;
  while(cin>>a[0]>>a[1]>>a[2]>>b[0]>>b[1]>>b[2]>>c>>d){
    sort(a,a+3);sort(b,b+3);
    if(a[0]<c&&c<a[2]&&b[0]<d&&d<b[2])cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
}

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

struct TCoordinate
{
	double x;
	double y;
};

bool IsSameSide(TCoordinate T1, TCoordinate T2, TCoordinate L1, TCoordinate L2)
{
	if(L1.x == L2.x){
		if((T1.x - L1.x) * (T2.x - L2.x) > 0){
			return true;
		}else{
			return false;
		}
	}else{
		if(((L2.x - L1.x) * (T1.y - L1.y) - (L2.y - L1.y) * (T1.x - L1.x)) * ((L2.x - L1.x) * (T2.y - L1.y) - (L2.y - L1.y) * (T2.x - L1.x)) > 0){
			return true;
		}else{
			return false;
		}
	}
}

int main()
{
	while(true){
		TCoordinate 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;
}