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>

template <typename T>
struct Vector
{
    T x , y;

    auto operator - (Vector v) -> Vector
    {
        return Vector <T> {x - v.x , y - v.y};
    }
    auto cross (Vector v) -> T
    {
        return x * v.y - y * v.x;
    }
};

auto main () -> int
{
    Vector <double> vecA , vecB , vecC , vecP;
    while (std::cin >> vecA.x >> vecA.y >> vecB.x >> vecB.y >> vecC.x >> vecC.y >> vecP.x >> vecP.y)
    {
        auto vecAB = vecB - vecA;
        auto vecBC = vecC - vecB;
        auto vecCA = vecA - vecC;

        auto vecAP = vecP - vecA;
        auto vecBP = vecP - vecB;
        auto vecCP = vecP - vecC;

        auto c1 = vecAB.cross (vecAP);
        auto c2 = vecBC.cross (vecBP);
        auto c3 = vecCA.cross (vecCP);

        if (c1 < 0 && c2 < 0 && c3 < 0 || c1 > 0 && c2 > 0 && c3 > 0)
        {
            std::cout << "YES" << std::endl;
        }
        else
        {
            std::cout << "NO" << std::endl;
        }
    }
}

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

struct Point2D {
    double x, y;

    Point2D() {}
    Point2D(double ax, double ay) {
        x = ax;
        y = ay;
    }
    Point2D operator -(Point2D &p) {
        return Point2D(x - p.x, y - p.y);
    }
    double cross(Point2D &p) { // only z
        return x * p.y - y * p.x;
    }
};

namespace std {
    istream &operator>>(istream &is, Point2D &p) {
        is >> p.x >> p.y;
        return is;
    }

    ostream &operator<<(ostream &os, Point2D &p) {
        os << fixed << p.x << " " << p.y;
        return os;
    }

    template <typename T>
    ostream &operator<<(ostream &os, vector<T> &v) {
        if (v.size()) {
            cout << v.front();
            for (auto vi = v.begin() + 1; vi != v.end(); vi++)
                cout << " " << *vi;
        }

        return os;
    }
}

template <typename T>
inline int sign(T x) { return (x > T(0)) - (x < T(0)); }

int main()
{
    vector<Point2D> triangle(3);
    Point2D p;

    for (; cin >> triangle[0] >> triangle[1] >> triangle[2] >> p;) {
        int acc = 0;
        for (int i = 0; i < 3; i++) {
            Point2D v = triangle[i] - triangle[(i + 1) % 3];
            Point2D pv = triangle[i] - p;

            acc += sign(v.cross(pv));
        }
        cout << ((abs(acc) == 3) ? "YES" : "NO") << endl;
    }

    return 0;
}

C++: #include <iostream>

struct Vec2D{
				double x,y;
};

Vec2D vector(double x1,double y1,double x2,double y2){
				Vec2D vec;
				vec.x = x2 -x1;
				vec.y = y2 -y1;
				return vec;
}

double outerProduct(Vec2D a,Vec2D b){
				double crossProduct = a.x * b.y - a.y * b.x;
				return crossProduct;
}

int main(int argc, char *argv[])
{
	double x1,x2,x3,y1,y2,y3,x,y;

	while(std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y){

		Vec2D BA = vector(x2,y2,x1,y1);
		Vec2D CB = vector(x3,y3,x2,y2);
		Vec2D AC = vector(x1,y1,x3,y3);


		Vec2D BP = vector(x2,y2,x,y);
		Vec2D CP = vector(x3,y3,x,y);
		Vec2D AP = vector(x1,y1,x,y);

		double a,b,c;

		a = outerProduct(BA,BP);
		b = outerProduct(CB,CP);
		c = outerProduct(AC,AP);



		if(a<0 && b<0 && c<0){
					std::cout << "YES" << std::endl;
		}else{
					std::cout << "NO" << std::endl;
		}

	}
}

C++: #include<iostream>
#include<stdio.h>
#include<cmath>

using namespace std;

#define EPS 1e-5

struct point{
	double x;
	double y;
};
struct line{
	double a; // 傾き
	double b; // 切片
};

int recog_point_place( const point& a , const point&b , const point& c );
bool get_line( const point& a , const point& b , line *a_b );

int main(void)
{
	point a, b, c, p;
	int input;

	while( scanf("%d", &input ) != EOF )
	{
		cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> p.x >> p.y;

		int result_ab_c = recog_point_place( a , b , c );
		int result_ab_p = recog_point_place( a , b , p );
		int result_bc_a = recog_point_place( b , c , a );
		int result_bc_p = recog_point_place( b , c , p );
		int result_ca_b = recog_point_place( c , a , b );
		int result_ca_p = recog_point_place( c , a , p );

		if( result_ab_c == result_ab_p && result_bc_a == result_bc_p && result_ca_b == result_ca_p ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}

	return 0;
}

int recog_point_place( const point& a , const point& b , const point& c )
{
	line a_b;

	bool result = get_line( a , b , &a_b );
	if( result == false )
	{
		if( (a.x + b.x)/2 < c.x ) return 1; // 点が直線より右にある場合に1をリターン
		else return 0;
	}
	else if( result == true )
	{
		if( c.y > a_b.a * c.x + a_b.b ) return 1; // 点が直線より上にある場合に1をリターン
		else return 0;
	}

}

bool get_line( const point& a , const point& b , line *a_b )
{
	if( fabs(a.x - b.x) < EPS )
	{
		return false;
	}
	else
	{
		a_b->a = (a.y - b.y) / (a.x - b.x);
		a_b->b = a.y - a_b->a * a.x;

		return true;
	}
}