Go: package main

import (
        "fmt"
)

func main() {
        var x1, y1, x2, y2, x3, y3, px, py float64
        var oax, oay, obx, oby, opx, opy float64
        var det float64
        var s, t float64

        for {
                _, err := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py)
                if err != nil {
                        break
                }
                oax = x2 - x1
                oay = y2 - y1
                obx = x3 - x1
                oby = y3 - y1
                opx = px - x1
                opy = py - y1
                det = oax*oby - obx*oay

                if det == 0 {
                        fmt.Printf("NO\n")
                } else {
                        s = (oby*opx - obx*opy) / det
                        t = (oax*opy - oay*opx) / det

                        if (s+t < 1 && s > 0 && t > 0) {
                                fmt.Printf("YES\n")
                        } else {
                                fmt.Printf("NO\n")
                        }
                }
        }
}

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

int judge(pair<double, double> p1, pair<double, double> p2){
	int S = p1.first*p2.second - p2.first*p1.second;
	if (0 < S) return 1;
	if (0 > S) return -1;
	if (0 == S) return 0;
}

int main(){
	pair<double, double> A, B, C, P;

	while (cin >> A.first >> A.second >> B.first >> B.second >> C.first >> C.second >> P.first >> P.second){
		pair<double, double> AB, BC, CA, AP, BP, CP;
		AB = { B.first - A.first, B.second - A.second };
		BC = { C.first - B.first, C.second - B.second };
		CA = { A.first - C.first, A.second - C.second };
		AP = { P.first - A.first, P.second - A.second };
		BP = { P.first - B.first, P.second - B.second };
		CP = { P.first - C.first, P.second - C.second };
		
		if (judge(AP, AB) == judge(BP, BC) && judge(BP, BC) == judge(CP, CA) && judge(CP, CA) == judge(AP, AB)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> xy_t;

double cross_product(xy_t a, xy_t b) {
  return (conj(a) * b).imag();
}

double x[4], y[4];
int main() {
  while (1) {
    for (int i = 0; i < 4; i++) cin >> x[i] >> y[i];
    if (!cin) break;
    xy_t a(x[0], y[0]), b(x[1], y[1]), c(x[2], y[2]), p(x[3], y[3]);
    double pab = cross_product(a-p, b-p);
    double pbc = cross_product(b-p, c-p);
    double pca = cross_product(c-p, a-p);
    bool ok = (pab * pbc >= 0 && pab * pca >= 0);
    cout << (ok ? "YES" : "NO") << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define rrep(i,n) for(int (i)=1;i<=(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define INF 1e18
#define int long long
#define endl "\n"
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};

double x, y;

bool cross(double a, double b, double c, double d) {
	return (c-a) * (y-b) - (x-a) * (d-b) > 0;
}

signed main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	
	double a, b, c, d, e, f;
	while(cin >> a >> b >> c >> d >> e >> f >> x >> y) {
		int cnt = 0;
		cnt += cross(a, b, c, d);
		cnt += cross(c, d, e, f);
		cnt += cross(e, f, a, b);
		if(cnt == 0 || cnt == 3) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
#define EPS 1.0e-5
using namespace std;

int main() {
  double x1,y1,x2,y2,x3,y3,xp,yp;
  double a[2],b[2];
  double A,B;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    a[0] = x2 - x1;
    a[1] = y2- y1;
    b[0] = x3 - x1;
    b[1] = y3 - y1;
    if(fabs(a[0] * b[1] -b[0] * a[1]) > 0) {
      A = ( b[1] * xp - b[0] * yp) / (a[0] * b[1] - b[0] * a[1]);
      B = (a[0] * yp - xp * a[1]) / (a[0] * b[1] - b[0] * a[1]);
      if ((A+B < 1) && (A > 0) && (B > 0)) {
        cout << "YES" << endl;
      }
      else {
        cout << "NO" << endl;
      }
    }
    else
      cout << "NO" << endl;
  }
}

C++: #include <cstdio>
#include <iostream>
#include <cmath>

using namespace std;

bool judge(double x[2], double y[2]) {
	double cross = x[0] * y[1] - y[0] * x[1];
	if(cross >= 0) return true;
	else return false;
}

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
		double ax[2], ay[2];
		x[0] = x2 - x1;
		y[0] = y2 - y1; 
		x[1] = xp - x1;
		y[1] = yp - y1;
		double bx[2], by[2];
		x[0] = x3 - x2;
		y[0] = y3 - y2;
		x[1] = xp - x2;
		y[1] = yp - y2;
		double cx[2], cy[2];
		x[0] = x1 - x3;
		y[0] = y1 - y3;
		x[1] = xp - x3;
		y[1] = yp - y3;
		if(judge(ax, ay) && judge(bx, by) && judge(cx, cy) || !judge(ax, ay) && !judge(bx, by) && !judge(cx, cy)) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> xy_t;

double cross_product(xy_t a, xy_t b) {
  return (conj(a) * b).imag();
}

double x[4], y[4];
int main() {
  while (1) {
    for (int i = 0; i < 4; i++) cin >> x[i] >> y[i];
    if (!cin) break;
    xy_t a(x[0], y[0]), b(x[1], y[1]), c(x[2], y[2]), p(x[3], y[3]);
    double pab = cross_product(a-p, b-p);
    double pbc = cross_product(b-p, c-p);
    double pca = cross_product(c-p, a-p);
    bool ok = (pab * pbc > 0 && pab * pca > 0);
    cout << (ok ? "YES" : "NO") << endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <algorithm>

using namespace std;

int main()
{
	double x[4] = {-1}, y[4] = {-1},xp,yp;
	double max_x, min_x, max_y, min_y;
	
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x[1], &y[1], &x[2], &y[2], &x[3], &y[3], &xp, &yp), x[1] != EOF){
		
		sort(x, x + 3);
		sort(y, y + 3);
		
		max_x = x[3];
		max_y = y[3];
		min_x = x[1];
		min_y = y[1];
		
		if (min_x < xp && xp < max_x && min_y < yp && yp < max_y){
			printf("YES\n");
		}
		else printf("NO\n");
	}
}

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 >= 1e-8)
    cout << "NO\n";
  else
    cout << "YES\n";
  
return 0;
}