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 <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;
    while(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.000000000000001) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}

C++: #include<iostream>
using namespace std;
int main(){
double a,b,c,d,e,f;
double x1,y1,x2,y2,x3,y3,xp,yp;
while(cin>>x1){
cin>>y1>>x2>>y2>>x3>>y3>>xp>>yp;
x1-=x3;y1-=y3;x2-=x3;y2-=y3;xp-=x3;yp-=y3;
if((a=x1*y2-x2*y1)>0)b=1;else b=-1;
if((c=b*(x1*yp-xp*y1))<0){cout<<"NO"<<endl;continue;}
if((d=b*(xp*y2-x2*yp))<0){cout<<"NO"<<endl;continue;}
if(c+d>a*b)cout<<"NO"<<endl;else cout<<"YES"<<endl;
}
return 0;
}

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

using namespace std;
#define EPS (1e-10)
#define ABS(x) ((x)<0?-(x):(x))
struct L{
    L(double xa, double ya, double xb, double yb){
	x1 = xa;
	y1 = ya;
	x2 = xb;
	y2 = yb;
	if(xa-xb == 0){
	    a = 1;
	    b = 0;
	    c = -xa;
	}
	else {
	    a = (ya-yb);
	    b = (xb-xa);
	    c = -(a*xa + b*ya);
	}
    };
    double f(double x, double y){
	return a*x + b*y + c;
    }
    double a, b, c, x1, x2, y1, y2;//0 = ax + by + c [x1, x2]
};

bool cross(L a, L b){
    return (a.f(b.x1, b.y1) * a.f(b.x2, b.y2) < 0 && 
	    b.f(a.x1, a.y1) * b.f(a.x2, a.y2) < 0);
}

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

int main(){
    while(cin){
	cin >> x1 >> y1 >> x2 >> y2>> x3 >> y3 >> xp >> yp;
	L a = L(x1, y1, x2, y2);
	L b = L(x1, y1, x3, y3);
	L c = L(x2, y2, x3, y3);
	L p = L(xp, yp, 1000, 2003.141592);
	int res = 0;
	if(cross(a,p))res++;
	if(cross(b,p))res++;
	if(cross(c,p))res++;
	if(res == 1)cout << "YES" <<  endl;
	else cout << "NO"<<endl;
    }
    return 0;
}

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

struct Vector{
	double x;
	double y;
};

Vector sub_vector(Vector &a , Vector &b){
	Vector ret;
	ret.x=a.x-b.x;
	ret.y=a.y-b.y;
	return ret;
}

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	Vector v[4];
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		v[0].x=x1; //a
		v[0].y=y1;
		v[1].x=x2; //b
		v[1].y=y2;
		v[2].x=x3; //c
		v[2].y=y3;
		v[3].x=xp;
		v[3].y=yp;
		Vector ab = sub_vector(v[1] , v[0]);
		Vector bp = sub_vector(v[3] , v[1]);
		Vector bc = sub_vector(v[2] , v[1]);
		Vector cp = sub_vector(v[3] , v[2]);
		Vector ca = sub_vector(v[0] , v[2]);
		Vector ap = sub_vector(v[3] , v[0]);
		double c1 = ab.x * bp.y - ab.y * bp.x;
		double c2 = bc.x * cp.y - bc.y * cp.x;
		double c3 = ca.x * ap.y - ca.y * ap.x;
		if((c1>0 && c2>0 && c3 >0) || (c1<0 && c2<0 && c3<0)){
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
		
	}
	return 0;
}

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

int main(){
  double x[3],y[3],xp,yp,xmax,ymax,xmin,ymin,ymid;

  xmax = 0; ymax = 0; xmin = 999999; ymin = 999999;
  while( cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp ){
    for(int i = 0 ; i < 3 ; i++ ){
      if( xmax < x[i] ) xmax = x[i];
      if( xmin > x[i] ) xmin = x[i];
      if( ymax < y[i] ) ymax = y[i];
      if( ymin > y[i] ) ymin = y[i];
    }

    ymid = (ymax + ymin)/2;

    if( (( xmin <= xp && xp <= xmax ) && (ymin <= yp && yp <= ymax )) && ( ymid >= yp ))
      cout <<"YES" << endl;
    else cout <<"NO" << endl;
  }

  return 0;
}

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

struct Point
{
    double x;
 
    double y;
};
 
double Abs(double x)
{
    return x>=0 ? x : -x;
}
 
double Triangle(const Point& P, const Point& Q, const Point& R)
{
    Point A = {Q.x-P.x, Q.y-P.y};
 
    Point B = {R.x-P.x, R.y-P.y};
 
    return Abs(A.x*B.y-A.y*B.x);
}

void SwapPoint(Point& a, Point& b)
{
	Point temp={0,0};

	temp =a;

	a=b;

	b=temp;
}

int main()
{
	Point a, b, c, x;

	bool flg=1;//点Xが三角形の中にある=1

	while(std::cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> x.x >>x.y)
	{
		for(int i=0; i<3; ++i)
		{
			if(Triangle(a,b,c)<Triangle(a,b,x)+Triangle(b,c,x))
			{
				flg=0;
			}

			SwapPoint(c,a);
			
			SwapPoint(b,c);
		}

		std::cout << (flg ? "YES\n" : "No\n");	
	}
}