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 <vector>

using namespace std;

vector<double> simlu_eq(int N, vector<vector<double>> M){
    int i, j, k, n;
    double pivot, mul;

    for (auto x:M){for(auto y:x){ cout << y << " ";}cout << endl;}


    for (i = 0; i < N; ++i){
        pivot = M[i][i];
        for (j = 0; j < N + 1; ++j){
            M[i][j] = (1 / pivot) * M[i][j];
        }

        for (auto x:M){for(auto y:x){ cout << y << " ";}cout << endl;}

        for (k = i + 1; k < N; ++k){
            mul = M[k][i];
            for (n = i; n < N + 1; ++n){
                M[k][n] = M[k][n] - mul * M[i][n];
            }
        }
    }

     for (auto x:M){for(auto y:x){ cout << y << " ";}cout << endl;}


     for (i = N -1; i > 0; --i){
         for (k = i -1; k >= 0; --k){
             mul = M[k][i];
             for (n = i; n < N + 1; ++n){
                 M[k][n] = M[k][n] - mul * M[i][n];
             }
         }
     }

     for (auto x:M){for(auto y:x){ cout << y << " ";}cout << endl;}


    vector<double> res;
    for (i = 0; i < N; ++i){
        res.push_back(M[i][N]);
    }

    cout << res[0] << " " << res[1] << " " << res[2] << endl;

    return res;
}


int main(){
    vector<double> a(2), b(2), c(2), p(2), ab(2), ac(2), ap(2);
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &a[0], &a[1], &b[0], &b[1], &c[0], &c[1], &p[0], &p[1])+1){

        ab[0] = b[0] - a[0];
        ab[1] = b[1] - a[1];
        ac[0] = c[0] - a[0];
        ac[1] = c[1] - a[1];
        ap[0] = p[0] - a[0];
        ap[1] = p[1] - a[1];


    vector<vector<double>>M;
    M = vector<vector<double>>(2, vector<double>(3));
    M[0][0] = ab[0];  M[0][1] = ac[0];  M[0][2] = ap[0];
    M[1][0] = ab[1];  M[1][1] = ac[1];  M[1][2] = ap[1];
    vector<double> w = simlu_eq(2, M);

    if (w[0] > 0 && w[1] > 0 && w[0] + w[1] < 1){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    }
}

C++: #include <iostream>


class vector_t {
public:
  double x;
  double y;
  double z;

public:
  vector_t(double x = 0, double y = 0, double z = 0) : x(x), y(y), z(z) {};

public:
  vector_t operator^(const vector_t& v) const {
    return vector_t(y * v.z - z * v.y,
                    z * v.x - x * v.z,
                    x * v.y - y * v.x);
  };
};


class point_t {
public:
  double x;
  double y;
  double z;
  double w;

public:
  point_t(double x = 0, double y = 0, double z = 0, double w = 1) : x(x), y(y), z(z), w(w) {};
  
public:
  vector_t operator-(const point_t& p) const {
    return vector_t(x - p.x, y - p.y, z - p.z);
  };
};


int main(int argc, char** argv)
{
  double x1, y1, x2, y2, x3, y3, xp, yp;

  while (std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    point_t p1(x1, y1);
    point_t p2(x2, y2);
    point_t p3(x3, y3);
    point_t p (xp, yp);

    if (((p2 - p1) ^ (p - p1)).z >= 0 &&
        ((p3 - p2) ^ (p - p2)).z >= 0 &&
        ((p1 - p3) ^ (p - p3)).z >= 0) {

      std::cout << "YES" << std::endl;
    }
    else {
      std::cout << "NO" << std::endl;
    }
  }
}

C++: #include "bits/stdc++.h"
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)



#define EPS (1e-10)
class P{                    //???
public:
    double x,y;
    
    P(double _x=0,double _y=0):x(_x),y(_y){};
    P operator + (P &p     ){ return P( x+p.x , y+p.y ); }  //??????
    P operator - (P &p     ){ return P( x-p.x , y-p.y ); }  //??????
    P operator * (double k ){ return P( x*k   , y*k    ); } //??????
    P operator / (double k ){ return P( x/k   , y/k    ); } //??????
    
    bool operator == (const P &p){ return ( fabs(x-p.x)<EPS && fabs(y-p.y)<EPS ); }
    //    bool operator < (const P &p)const{ return ( x!=p.x ? x<p.x:y<p.y ); }
    
    double norm(){ return x*x+y*y; }        //?????????
    double abs() { return sqrt(norm()); }   //??§??????
    
};
struct L{P p1,p2;};         //??´???
typedef vector<P> Polygon;  //????§???¢
typedef P Vector;           //????????????

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 ccw(P p0,P p1,P p2){    //AOJ_BOOK_P386 verified
    Vector a = p1 - p0;
    Vector b = p2 - p0;
    
    if( cross(a,b) > EPS  ) return 1 ;      //COUNTER_CLOCKWISE
    if( cross(a,b) < -EPS ) return -1;      //CLOCKWISE
    if( dot(a,b)   < -EPS ) return 2;       //ONLINE_BACK
    if( a.norm()   < b.norm() ) return -2;  //ONLINE_FRONT
    
    return 0;                               //ON_SEGMENT;
}

//?????????????????? verified
bool intersect(P p1,P p2,P p3,P p4){ return ( ccw(p1,p2,p3)*ccw(p1,p2,p4)<=0 && ccw(p3,p4,p1)*ccw(p3,p4,p2)<=0 ); }

//????????¨???????????¢ verified ARC042-B
double distance_l_p(L l, P p) { return abs(cross(l.p2-l.p1, p-l.p1)) /(l.p2-l.p1).abs(); }

//????????¨??????????????????(????????£???????????´??????????????±???)
bool intersect_circle_point(P center, double r, L line){
    if( distance_l_p(line,center) <= r+EPS ) return true;
    return false;
}


//????´?????§???¢??????
bool isSimple( Polygon pol ){
    //???????????????????????????pol?????\????????????
    size_t pol_size = pol.size()-1;
    rep(i,pol_size){
        for(int j=i+2;j<pol_size;j++){
            if( i==j || i==(j-1+pol_size)%pol_size || i==(j+1+pol_size)%pol_size )continue;
            if( intersect(pol[i], pol[i+1], pol[j], pol[j+1]) )return false;
        }
    }
    return true;
}


//??????????§???¢????????´?????????????????????????±???????
int isPointInsidePolygon(vector<L> side,P point){
    long sideSum=side.size();
    int count=0;
    
    for(int i=0;i<sideSum;i++){

        double result = cross(side[i].p2-side[i].p1,point-side[i].p1);
        
        
        if(result>0)count++;
        
    }
    if(count%sideSum==0)return 1;    //???????????´?????????
    else return 0;
    
}


int main(){
    double a,b,c,d,e,f,g,h;
    while(cin>>a>>b>>c>>d>>e>>f>>g>>h){
        vector<L> angle;
        angle.pb( L{P(a,b),P(c,d)} );
        angle.pb( L{P(c,d),P(e,f)} );
        angle.pb( L{P(e,f),P(a,b)} );
        
        if(isPointInsidePolygon(angle,P(g,h))){
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
    }
    
    
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main() {
  float x1, y1, x2, y2, x3, y3, px, py;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> px >> py) {
  float d_x1, d_y1, d_x2, d_y2, d_x3, d_y3;
  d_x1 = (x1 - px) / abs(x1 - px);
  d_y1 = (y1 - py) / abs(y1 - py);
  d_x2 = (x2 - px) / abs(x2 - px);
  d_y2 = (y2 - py) / abs(y2 - py);
  d_x3 = (x3 - px) / abs(x3 - px);
  d_y3 = (y3 - py) / abs(y3 - py);
  if (abs(d_x1 + d_x2 + d_x3) < 3 && abs(d_y1 + d_y2 + d_y3) < 3) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  }
  return 0;
}