Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

struct coordinates{
	double x;
	double y;
};
typedef struct coordinates coordinates_t;

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


int main()
{
	
	coordinates_t A,B,C,P;
	while(cin >>A.x>>A.y>>B.x>>B.y>>C.x>>C.y>>P.x>>P.y){
		
		coordinates_t AB = sub_vector(B, A);
		coordinates_t BP = sub_vector(P, B);
		
		coordinates_t BC = sub_vector(C, B);
		coordinates_t CP = sub_vector(P, C);
		
		coordinates_t CA = sub_vector(A, C);
		coordinates_t AP = sub_vector(P, A);
		
		// 外積
		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>
#include <cmath>
using namespace std;

int main(void){
ツ　ツ　double x1, y1, x2, y2, x3, y3, px, py;
ツ　ツ　double a, b, c, ap, bp, cp;
ツ　ツ　double tmp;
ツ　ツ　double s2, sa2, sb2, sc2;
ツ　ツ　double s, sa, sb, sc;

ツ　ツ　while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>px>>py){
ツ　ツ　ツ　ツ　a = sqrt(fabs((x2-x3) * (x2-x3) + (y2-y3) * (y2-y3)));
ツ　ツ　ツ　ツ　b = sqrt(fabs((x1-x3) * (x1-x3) + (y1-y3) * (y1-y3)));
ツ　ツ　ツ　ツ　c = sqrt(fabs((x1-x2) * (x1-x2) + (y1-y2) * (y1-y2)));
ツ　ツ　ツ　ツ　ap = sqrt(fabs((x1-px) * (x1-px) + (y1-py) * (y1-py)));
ツ　ツ　ツ　ツ　bp = sqrt(fabs((x2-px) * (x2-px) + (y2-py) * (y2-py)));
ツ　ツ　ツ　ツ　cp = sqrt(fabs((x3-px) * (x3-px) + (y3-py) * (y3-py)));
ツ　ツ　ツ　ツ　
ツ　ツ　ツ　ツ　tmp = (a+b+c) / 2;
ツ　ツ　ツ　ツ　s2 = tmp * (tmp-a) * (tmp-b) * (tmp-c);
ツ　ツ　ツ　ツ　s = sqrt(s2);
ツ　ツ　ツ　ツ　tmp = (a+bp+cp) / 2;
ツ　ツ　ツ　ツ　sa2 = tmp * (tmp-a) * (tmp-bp) * (tmp-cp);
ツ　ツ　ツ　ツ　sa = sqrt(sa2);
ツ　ツ　ツ　ツ　tmp = (b+ap+cp) / 2;
ツ　ツ　ツ　ツ　sb2 = tmp * (tmp-b) * (tmp-ap) * (tmp-cp);
ツ　ツ　ツ　ツ　sb = sqrt(sb2);
ツ　ツ　ツ　ツ　tmp = (c+ap+bp) / 2;
ツ　ツ　ツ　ツ　sc2 = tmp * (tmp-c) * (tmp-ap) * (tmp-bp);
ツ　ツ　ツ　ツ　sc = sqrt(sc2);
ツ　ツ　ツ　ツ　if(fabs(sa+sb+sc-s) < ie-9) cout << "YES" << endl;
ツ　ツ　ツ　ツ　else cout << "NO" << endl;
ツ　ツ　}
ツ　ツ　return 0;
}

C++: #include<iostream>
#include<stdlib.h>
#include<math.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 <complex>
using namespace std;

typedef complex<double> Pt;
double cross(const Pt &a, const Pt &b) { return imag(conj(a)*b); }

int main()
{
    double x1, x2, x3, y1, y2, y3, xp, yp;
    while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
    {
        Pt a = Pt(x1, y1), b = Pt(x2, y2), c = Pt(x3, y3), p = Pt(xp, yp);
        a -= p; b -= p; c -= p;
        cout << (cross(a, b) >= 0 && cross(b, c) >= 0 && cross(c, a) >= 0 ? "YES" : "NO") << endl;
    }
}

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

int edinton(int i,int j, int k);
double cross(double *a,double *b);

int main(){
    double p[4][3],z[3];
    while(1){
        int sum=0;
        for(int l=0;l<4;l++){
            cin >> p[l][0] >> p[l][1];
            p[l][2]=0;
        }
        for(int i=0;i<3;i++){
            z[i]=cross(p[i],p[3]);
            z[i]=z[i]/fabs(z[i]);
            sum+=z[i];
        }
        if(sum==3) cout << "YES" << endl;
        else{
            cout << "NO" << endl;
            break;
        }
    }
    return 0;
}

int edinton(int i,int j, int k){
    int a=1,b=2,c=3,d;
    for(int l=0;l<3;l++){
        if(i==a&&j==b&&k==c) return 1;
        d=c;c=b;b=a;a=d;
    }
    a=3; b=2; c=1;
    for(int l=0;l<3;l++){
        if(i==a&&j==b&&k==c) return -1;
        d=c;c=b;b=a;a=d;
    }
    return 0;
}
double cross(double *a,double *b){
    double c=0;
    for(int i=1;i<=3;i++)
        for(int j=1;j<=3;j++)
            for(int k=1;k<=3;k++){
                c+=edinton(i, j, k)*a[j]*b[k];
            }
    return c;
}

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

double check(double x1, double y1, double x2, double y2, double x3, double y3){
	double ab = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
	double bc = sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3));
	double ca = sqrt((x3 - x1) * (x3 - x1) + (y3 - y1) * (y3 - y1));
	double s = (ab + bc + ca) * 0.5;
	double S = sqrt(s * (s - ab) * (s - bc) * (s - ca));
	return S;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
	
	double abc = check(x1, y1, x2, y2, x3, y3);
	double abp = check(x1, y1, x2, y2, xp, yp);
	double bcp = check(x2, y2, x3, y3, xp, yp);
	double cap = check(x3, y3, x1, y1, xp, yp);
	
	double var = abc - (abp + bcp + cap);
	if(var <= 0.001 && var >= -0.001){
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
	}
	
	return 0;
}

C++: 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0

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

int main()
{
	double x1, x2, x3, y1, y2, y3, px, py;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> px >> py) {
		double j1 = (x1 - x2)*(py - y2) - (px - x2)*(y1 - y2),
		       j2 = (x3 - x1)*(py - y1) - (px - x1)*(y3 - y1),
			   j3 = (x2 - x3)*(py - y3) - (px - x3)*(y2 - y3);
		if ((j1 < 0 && j2 < 0 && j3 < 0) || (j1 > 0 && j2 > 0 && j3 > 0))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}