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 <cmath>
using namespace std;

double Area(double* x1, double* y1, double* x2, double* y2){
  return (*x1 * *y2 - *x2 * *y1)/2.0;
}

double Segitiga(double* a, double * b, double* c, double* d, double* e, double* f){
  return abs (Area(a,b,c,d) + Area(c,d,e,f) + Area(e,f,a,b));
}

int main(){
  double a, b, c, d, e, f, g, h, ta, tb;
  cin >> a >> b >> c >> d >> e >> f >> g >> h;
  ta = Segitiga(&a, &b, &c, &d, &e, &f);
  tb = Segitiga(&a, &b, &c, &d, &g, &h) + Segitiga(&a, &b, &e, &f, &g, &h) + Segitiga(&c, &d, &e, &f, &g, &h);

  if(tb > ta)
    cout << "NO\n";
  else
    cout << "YES\n";
  
return 0;
}

C++: #include <iostream>

template <class T>
struct vec {
  T x, y;
  vec(const T& _x, const T& _y) : x(_x), y(_y) {}
  vec<T> operator+(const vec<T>& rhs) const {
    return vec<T>(x + rhs.x, y + rhs.y);
  }
  vec<T> operator-(const vec<T>& rhs) const {
    return vec<T>(x - rhs.x, y - rhs.y);
  }
};

using namespace std;

int main(int ac, char **av) {
  float x1, x2, x3, y1, y2, y3, xp, yp;
  while (1) {
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
    if (x1 != 0 && x2 != 0) {
      break;
    }
    vec<float> T1 {x1, y1};
    vec<float> T2 {x2, y2};
    vec<float> T3 {x3, y3};
    vec<float> Tp {xp, yp};

    auto ab = T2 - T1;
    auto bp = Tp - T2;
    auto bc = T3 - T2;
    auto cp = Tp - T3;
    auto ca = T1 - T3;
    auto ap = Tp - T1;

    auto c1 = ab.x * bp.y - ab.y * bp.x;
    auto c2 = bc.x * cp.y - bc.y * cp.x;
    auto 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;
    }

    x1 = y1 = 0;
    x2 = y2 = 0;
    x3 = y3 = 0;
    xp = yp = 0;
  }
  return 0;
}

C++: #include<cstdio>

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	int flug;
	double h;
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp) + 1){
		x1 -= xp;
		x2 -= xp;
		x3 -= xp;
		y1 -= yp;
		y2 -= yp;
		y3 -= yp;
		flug = 0;
		if(x1 < 0.00001 || x1 > -0.00001){
			if(y1 > 0){
				if(y2 < 0 && y3 < 0){
					if(x2 * x3 < 0){
						flug = 1;
					}
				}
			}else{
				if(y2 > 0 && y3 > 0){
					if(x2 * x3 < 0){
						flug = 1;
					}
				}
			}
		}else{
			h = (y1 / x1 * x2 - y2)*(y1 / x1 * x3 - y3);
			if(x1 * x2 > 0 && y1 * y2 > 0){
				if(x3 * x1 < 0 && y3 * y1 < 0){
					if(h > 0){
						if(y2 / x2 * x1 - y3 < 0){
							flug = 1;
						}
					}
				}
			}
		}
		if(flug){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
 
int main(){
	double x1, x2, x3, y1, y2, y3, xp, yp;
	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
		double cross1 = (x2-x1)*(yp-y1)-(y2-y1)*(xp-x1);
		double cross2 = (x3-x2)*(yp-y2)-(y3-y2)*(xp-x2);
		double cross3 = (x1-x3)*(yp-y3)-(y1-y3)*(xp-x3);
		if(cross1 < 0 && cross2 < 0 && cross3 < 0 || cross1 > 0 && cross2 > 0 && cross3 > 0){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

//double cross(double x1,double y1,double x2,double y2)
//{
//	return x1*y2-x2*y1;
//}
#define cross(x1,y1,x2,y2) (x1)*(y2)-(x2)*(y1)

int ccw(double x1,double y1,double x2,double y2,double x3,double y3)
{
	return cross(x2-x1,y2-y1,x3-x1,y3-y1)>0;
}

int main()
{
	//float x,y,a,b,n,m,p,q;
	//int i;
	//for(;~scanf("%f%f%f%f%f%f%f%f",&x,&y,&a,&b,&n,&m,&p,&q);puts(i>2^!i?"YES":"NO"))
	//	i=((p-x)*(b-y)>(q-y)*(a-x))+((p-a)*(m-b)>(q-b)*(n-a))+((p-n)*(y-m)>(q-m)*(x-n));
	
	for(double x,y,a,b,n,m,p,q;scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x,&y,&a,&b,&n,&m,&p,&q)==8;){
		int counter=0;
		//counter+=(p-x)*(b-y)-(q-y)*(a-x)>0;
		//counter+=(p-a)*(m-b)-(q-b)*(n-a)>0;
		//counter+=(p-n)*(y-m)-(q-m)*(x-n)>0;
		counter+=cross(a-x,b-y,p-x,q-y)>0;
		counter+=cross(n-a,m-b,p-a,q-b)>0;
		counter+=cross(x-n,y-m,p-n,q-m)>0;
		
		cout<<(counter%3==0?"YES":"NO")<<endl;
	}
	
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
double h(double x1,double y1,double x2,double y2,double px,double py){
	  double ax, ay, bx, by;
	  ax = x2 - x1;
	  ay = y2 - y1;
	  bx = px - x1;
	  by = py - y1;
	  return ax*by-ay*bx;
}
int main()
{
	double x1,x2,x3,y1,y2,y3,xp,yp,a,b,c;
	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
		a=h(x1,y1,x2,y2,xp,yp);
		b=h(x2,y2,x3,y3,xp,yp);
		c=h(x3,y3,x1,y1,xp,yp);
		if((a>0&&b>0&&c>0)||(a<0&&b<0&&c<0)){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}

	return 0;
}

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;
    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 <algorithm>
using namespace std;

int main()
{
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    if(y1 < y2){
      swap(x1, x2);
      swap(y1, y2);
    }
    if(y1 < y3){
      swap(x1, x3);
      swap(y1, y3);
    }
    
    if(((x2 - x1 != 0) ? (yp < (y2 -y1) / (x2 - x1) * (xp - x1) + y1) : (0 < (y2 - y1) * (xp - x1))) && ((x3 - x1 != 0) ? (yp < (y3 -y1) / (x3 - x1) * (xp - x1) + y1) : (0 < (y3 - y1) * (xp - x1))) && ((x2 - x3 != 0) ? (yp > (y2 -y3) / (x2 - x3) * (xp - x3) + y3) : (0 < (y2 - y3) * (xp - x3)))){
	cout << "YES" << endl;
      }else{
      cout << "NO" << endl;
    }
  }
}