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;
int main(){
  double x[2],y[2],z[2],p[2];
  while(cin >>x[0]>>x[1]>>y[0]>>y[1]>>z[0]>>z[1]>>p[0]>>p[1]){
    double v[3][2],vp[3][2];
    v[0][0] = y[0]-x[0];
    v[0][1] = y[1]-x[1];
    v[1][0] = z[0]-y[0];
    v[1][1] = z[1]-y[1];
    v[2][0] = x[0]-z[0];
    v[2][1] = x[1]-z[1];
    vp[0][0] = p[0]-x[0];
    vp[0][1] = p[1]-x[1];
    vp[1][0] = p[0]-y[0];
    vp[1][1] = p[1]-y[1];
    vp[2][0] = p[0]-z[0];
    vp[2][1] = p[1]-z[1];
    bool f = true;
    for(int i=0; i<3; i++){
      if(v[i][0]*vp[i][1]-v[i][1]*vp[i][0]<0){
	f = false;
      }
    }
    if(f) cout <<"YES"<<endl;
    else cout <<"NO"<<endl;
  }
  return 0;
}

C++: #include<stdio.h>

double area(double x1, double y1, double x2, double y2, double x3, double y3)
{
    return(.5*(x1*(y2-y3)+x2*(y3-y2)+x3*(y1-y2)));
}

int main()
{
    double x1,y1,x2,y2,x3,y3,x4,y4,abc,aob,aoc,boc,abc2;
    while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4)==8)
    {
        abc=area(x1,y1,x2,y2,x3,y3);
        aob=area(x1,y1,x4,y4,x2,y2);
        aoc=area(x1,y1,x4,y4,x3,y3);
        boc=area(x2,y2,x4,y4,x3,y3);
        abc2=aob+aoc+boc;
        if(abc>abc2)
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}

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;
}

bool 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()
{
	for(string s;getline(cin,s);){
		istringstream iss(s);
		vector<double> x(3),y(3);
		rep(i,3)
			iss>>x[i]>>y[i];
		double xp,yp;
		iss>>xp>>yp;
		
		if(!ccw(x[0],y[0],x[1],y[1],x[2],y[2])){
			swap(x[1],x[2]);
			swap(y[1],y[2]);
		}
		
		bool in_triangle=true;
		rep(i,3){
			if(!ccw(x[0],y[0],x[1],y[1],xp,yp))
				in_triangle=false;
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}
		
		cout<<(in_triangle?"YES":"NO")<<endl;
	}
	
	return 0;
}

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

struct Point {
  double X, Y;
  Point(double x, double y) :X(x), Y(y) {}
};

double cross(Point p0, Point p1, Point p2) {
  Point a = Point(p1.X - p0.X, p1.Y - p0.Y);
  Point b = Point(p2.X - p0.X, p2.Y - p0.Y);
  return a.X * b.Y - a.Y * b.X;
}

bool is_contain(Point a, Point b, Point c, Point p) {
  double c1 = cross(a, b, p);
  double c2 = cross(b, c, p);
  double c3 = cross(c, a, p);
  if (c1 > 0 && c2 > 0 && c3 > 0) return true;
  if (c1 < 0 && c2 < 0 && c3 < 0) return true;
  return false;
}

int main() {
  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)) {
    Point a = Point(x1, y1);
    Point b = Point(x2, y2);
    Point c = Point(x3, y3);
    Point p = Point(xp, yp);
    if (is_contain(a, b, c, p)) puts("YES");
    else puts("NO");
  }
}

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

using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)

bool judge(double x[3], double y[3]) {
	double rad1 = atan2(y[0], x[0]);
	cout << rad1 << endl;
	double rad2 = atan2(y[1], x[1]);
	cout << rad2 << endl;
	double rad3 = atan2(y[2], x[2]);
	cout << rad3 << endl;
	if(rad3 < rad1 && rad2 < rad3 || rad1 < rad3 && rad3 < rad2) return true;
	else return false;
}

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
		double x[3], y[3];
		x[0] = x2 - x1;
		y[0] = y2 - y1; 
		x[1] = x3 - x1;
		y[1] = y3 - y1;
		x[2] = xp - x1;
		y[2] = yp - y1;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			break;
		}
		x[0] = x1 - x2;
		y[0] = y1 - y2;
		x[1] = x3 - x2;
		y[1] = y3 - y2;
		x[2] = xp - x2;
		y[2] = yp - y2;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			break;
		}
		cout << "YES" << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	double v0[2], v1[2], v2[2], p[2];	//[0]にx座標、[1]にy座標

	while (cin >> v0[0] >> v0[1] >> v1[0] >> v1[1] >> v2[0] >> v2[1] >> p[0] >> p[1])
	{
		double v0v1[2] = {v1[0]-v0[0], v1[1]-v0[1]},
			   v1v2[2] = {v2[0]-v1[0], v2[1]-v1[1]},
			   v2v0[2] = {v0[0]-v2[0], v0[1]-v2[1]},
			   v0p[2]  = {p[0]-v0[0],  p[1]-v0[1]},
			   v1p[2]  = {p[0]-v1[0],  p[1]-v1[1]},
			   v2p[2]  = {p[0]-v2[0],  p[1]-v2[1]},

			   vv0 = v0v1[0]*v0p[1] - v0v1[1]*v0p[0],
			   vv1 = v1v2[0]*v1p[1] - v1v2[1]*v1p[0],
			   vv2 = v2v0[0]*v2p[1] - v2v0[1]*v2p[0];

		if((vv0>0 && vv1>0 && vv2>0) || (vv0<0 && vv1<0 && vv2<0)) {
			cout << "YES" << endl;
		}else{
			cout << "NO"  << endl;
		}
	}

	return 0;
}

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

using namespace std;

struct Point {
    double x, y;
};

double len(Point p1, Point p2) {
    return sqrt((p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y));
}

double area(Point *points) {
    double a = len(points[0], points[1]);
    double b = len(points[1], points[2]);
    double c = len(points[2], points[0]);
    double s = (a + b + c) / 2;
    return sqrt(s*(s - a)*(s - b)*(s - c));
}

int is_in(Point *points, Point search) {
    double src = area(points);
    double a, b, c;
    
    swap(points[0], search);
    a = area(points);
    swap(points[0], search);

    swap(points[1], search);
    b = area(points);
    swap(points[1], search);

    swap(points[2], search);
    c = area(points);
    swap(points[2], search);

    if (src - 1e-5 < a + b + c && a + b + c < src + 1e-5) {
        return 1;
    }
    else {
        return 0;
    }
}

int main() {
    while (1) {
        Point points[3];
        Point search;

        for (int i = 0; i < 3; i++) {
            if (!(cin >> points[i].x >> points[i].y)) {
                return 0;
            }
        }
        cin >> search.x >> search.y;
    
        if (is_in(points, search) == 1) {
            cout << "YES\n";
        }
        else {
            cout << "NO\n";
        }
    }
    
    return 0;
}