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<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>
#define curr(P, i) P[(i) % P.size()]
#define next(P, i) P[(i+1) % P.size()]
using namespace std;
 
double EPS = 1e-10;
 
double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}
 
struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}
  point operator + (point p){return point(add(x,p.x), add(y,p.y));}
  point operator - (point p){return point(add(x,-p.x), add(y,-p.y));}
};
 
double dot(point a, point b){return a.x*b.x+a.y*b.y;}
double cross(point a, point b){return a.x*b.y-a.y*b.x;}
 
int is_point_on_line(point a, point b, point c) {
  return cross(b-a,c-a)==0.0 && dot(b-a,c-a)>-EPS && dot(a-b,c-b)>-EPS;
}
 
int is_intersected_ls(point a1, point a2, point b1, point b2) {
  if(cross(a1-a2,b1-b2)==0){
    return is_point_on_line(a1,a2,b1) || is_point_on_line(a1,a2,b2) 
        || is_point_on_line(b1,b2,a1) || is_point_on_line(b1,b2,a2);
  }
  else {
    return (cross(a2-a1, b1-a1)*cross(a2-a1, b2-a1)<EPS ) &&
           (cross(b2-b1, a1-b1)*cross(b2-b1, a2-b1)<EPS );
  }
}
 
int contain(point p, vector<point> ps){
  point a=p,b(1000000,p.y);
 
  double ymx=-DBL_MAX,ymn=DBL_MAX;
  for(int i=0;i<ps.size();i++){
    ymx=max(ymx,ps[i].y);
    ymn=min(ymn,ps[i].y);
  }
  if(a.y<=ymn||a.y>=ymx)return 0;
 
  int cnt=0,cnt1=0;
  for(int i=0;i<ps.size();i++)
    if(is_point_on_line(a,b,ps[i]))cnt1++;
   
  for(int i=0;i<ps.size();i++)
    if(is_intersected_ls(ps[i],next(ps,i),a,b))cnt++;
  
  return (cnt-cnt1)%2;
}
 
 
int main(void){
  
  point in[4],p;
 
  while(true){
    vector<point>ps(3);
 
    for(int i=0;i<3;i++)
      if(!(cin >> ps[i].x >> ps[i].y))return 0;
 
    cin >> p.x >> p.y;
     
    if(contain(p,ps))cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

/*??\??????????????°??????????????????????£?????????°????????¨??????*/
/*???????????¨??????????????????????????§???????????§?????????????£??????????*/
class Vector2D {
  private:
    double x;
    double y;
  public:
    Vector2D(double _x, double _y) {
      x = _x;
      y = _y;
    }
    double operator * (Vector2D vec2) {
      return this->x*vec2.y-this->y*vec2.x;
    }
};

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

  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    Vector2D vec_12(x2-x1,y2-y1);
    Vector2D vec_2p(xp-x2,yp-y2);
    
    Vector2D vec_23(x3-x2,y3-y2);
    Vector2D vec_3p(xp-x3,yp-y3);

    Vector2D vec_31(x1-x3,y1-y3);
    Vector2D vec_1p(xp-x1,yp-y1);

    double crossproduct1 = vec_12*vec_2p;
    double crossproduct2 = vec_23*vec_3p;
    double crossproduct3 = vec_31*vec_1p;

    if ((crossproduct1 > 0 && crossproduct2 > 0 && crossproduct3 > 0) ||
        (crossproduct1 < 0 && crossproduct2 < 0 && crossproduct3 < 0))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }

  return 0;
}

C++: import java.util.*;
public class Main{
  private static String a;
  static double xp,yp,z,x1,y1;
  public static double[] w(double[] x, double[] y) {
	  x[2] = -x[2];
	  y[2] = -y[2];
	  z = (x[0] * y[1] )- (x[1] * y[0]);
	  x1 = +(y[1] * x[2]) - (x[1] * y[2]);
	  y1 = +(x[0] * y[2]) - (y[0] * x[2]);
	  return new double[] { (x1 / z), (y1 / z) };
	}
public static void main(String [] args){
	  Scanner cs = new Scanner(System.in);
	  double[] x = new double[3];
	  double[] y = new double[3];
	  while (cs.hasNextDouble()) {  {
	      for (int i = 0; i < 3; i++) {
	        x[i] = cs.nextDouble();
	        y[i] = cs.nextDouble();
	      }
	       xp = cs.nextDouble();
	       yp = cs.nextDouble();
	      for (int i = 0; i < 3; i++) {
	        x[i] -= xp;
	        y[i] -= yp;
	      }
	    }
	    double[] X = w(x, y);
	    if (X[0] >= 0 && X[1] >= 0) System.out.println("YES");
	   else System.out.println("NO");
	    }
	  }
	
	}

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

int main(void) {
	double x[4], y[4];
	double xp, yp;

	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) {
		bool l, r;
		l = r = false;
		
		x[3] = x[0];
		y[3] = y[0];

		for(int i = 0; i < 3; i++) {
			double ax = x[i+1] - x[i];
			double ay = y[i+1] - y[i];
			double px = xp - x[i];
			double py = yp - x[i];
			if(ax*py - ay*px < 0)
				r = true;
			else
				l = true;
		}
		cout << (r ^ l ? "YES" : "NO") << endl;
	}
	return 0;
}

C++: //ツ陛環嘉ー ツ外ツ静渉づーツ使ツづづ嘉ーツつュ
#include <iostream>
using namespace std;

class Vector2{
public:
	Vector2(){}
	Vector2( double aX, double aY ) : x( aX ), y( aY ){}

	double cross( Vector2& a ){
		return ( x * a.y ) - ( y * a.x );
	}

	double x;
	double y;
};

int main(){
	Vector2 p0, p1, p2, q;

	while ( cin >> p0.x >> p0.y >> p1.x >> p1.y >> p2.x >> p2.y >> q.x >> q.y ){
		bool isInner = false;
		Vector2 ab( p1.x - p0.x, p1.y - p0.y );
		Vector2 bc( p2.x - p1.x, p2.y - p1.y );
		Vector2 ca( p0.x - p2.x, p0.y - p2.y );
		Vector2 ap( q.x - p0.x, q.y - p0.y );
		Vector2 bp( q.x - p1.x, q.y - p1.y );
		Vector2 cp( q.x - p2.x, q.y - p2.y );

		if( (ab.cross( ap ) > 0 ) &&
			(bc.cross( bp ) > 0 ) &&
			(ca.cross( cp ) > 0 ) ){
			isInner = true;
		}

		cout << ( isInner ? "YES" : "NO" ) << endl;
	}

	return 0;
}