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 <stdio.h>
#include <math.h>
 
int main()
{
    double x1, x2, x3, y1, y2, y3, xp, yp;
    double s, s1, s2, s3;
     
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp) != EOF){
        //?????§????¢??????¢???
        s  = ((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1)) / 2.0; 
        s1 = ((xp - x1) * (y2 - y1) - (yp - y1) * (x2 - x1)) / 2.0;
        s2 = ((xp - x1) * (y3 - y1) - (yp - y1) * (x3 - x1)) / 2.0;
        s3 = ((xp - x2) * (y3 - y2) - (yp - y2) * (x3 - x2)) / 2.0;
         
        s  = fabs(s);
        s1 = fabs(s1);
        s2 = fabs(s2);
        s3 = fabs(s3);
         
        if (fabs(s -fabs(s1 + s2 + s3))<1e-10) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}

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;
    }
  }
}

C++: #include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

int main() {
  // ifstream cin("../test.txt");
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    bool res = false;
    // 平行移動
    x2 -= x1;
    x3 -= x1;
    xp -= x1;
    y2 -= y1;
    y3 -= y1;
    yp -= y1;
    // 傾き
    if (((y3 * xp > yp * x3) && (yp * x2 > y2 * xp)) || ((y2 * xp > yp * x2) && (yp * x3 > y3 * xp)))
      res = true;

    if (!res) {
      cout << "NO" << endl;
      continue;
    }

    // cout << "ok" << endl;
    // 直線BCの下にある
    // y - y1 = (y2 - y1)/(x2 - x1) (x - x1)
    if ( (y3 - y2) * (xp - x2) - (x3 - x2) * (yp - y2) > 0 )
      res = false;

    if (res) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }

}

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

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

int main()
{
	double x[4],y[4];
	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 s1 = crossPro(a-p,b-p);
		double s2 = crossPro(b-p,c-p);
		double s3 = crossPro(c-p,a-p);
		bool ok = false;
		if (((s1>0)&&(s2>0)&&(s3>0))||((s1<0)&&(s2<0)&&(s3<0)))
		{
			ok = true;
		}

		if (ok)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

struct Point { double x,y;} p[4];

bool isIntersect(int i, int j, int k, int l){
	double kd = ((p[i].x - p[j].x) * (p[k].y - p[i].y) + (p[i].y - p[j].y) * (p[i].x - p[k].x));
	double ld = ((p[i].x - p[j].x) * (p[l].y - p[i].y) + (p[i].y - p[j].y) * (p[i].x - p[l].x));
	return (kd*ld<0);
}

int main(){
	while(1){
		if(cin.eof()) break;
		for(int i=0; i<4; i++)
			cin >> p[i].x >> p[i].y;
		if(!cin.eof()){
			if (isIntersect(0, 1, 2, 3) || isIntersect(0, 2, 1, 3) || isIntersect(1, 2, 0, 3))
				cout << "NO";
			else cout << "YES";
			cout << endl;
		}
	}
	return 0;
}

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

const double EPS = 1e-9;

struct Vec2d{
  double x,y;
};

double cross(Vec2d &A, Vec2d &B){
  return A.x*B.y - A.y*B.x;
}

int main(void){
  double x1,y1,x2,y2,x3,y3,xp,yp;
  while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
	  Vec2d AB,AP,BC,BP,CA,CP;
	  AB.x = x2-x1;AB.y = y2-y1;
	  BC.x = x3-x2;BC.y = y3-y2;
	  CA.x = x1-x3;CA.y = y1-y3;
	  AP.x = xp-x1;AP.y = yp-y1;
	  BP.x = xp-x2;BP.y = yp-y2;
	  CP.x = xp-x3;CP.y = yp-y3;
	  if(fabs(cross(AB,AP))>EPS && fabs(cross(BC,BP))>EPS && fabs(cross(CA,CP)>EPS)) cout<<"YES"<<endl;
	  else cout<<"NO"<<endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
#include <math.h>
 
int main()
{
    double x1, y1, x2, y2, x3, y3, x, y;
    double ax, ay, bx, by;
    double z1, z2, z3; // ????????????A??¨????????????B????????????z??????
     
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y) {
        ax = x2 - x1;
        ay = y2 - y1;
        bx = x - x1;
        by = y - y1;
        z1 = ax * by - ay * bx;
         
        ax = x3 - x2;
        ay = y3 - y2;
        bx = x - x2;
        by = y - y2;
        z2 = ax * by - ay * bx;
         
        ax = x1 - x3;
        ay = y1 - y3;
        bx = x - x3;
        by = y - y3;
        z3 = ax * by - ay * bx;
         
        if ( ( (z1 > 0) && (z2 > 0) && (z3 > 0) ) || ( (z1 < 0) && (z2 < 0) && (z3 < 0) ) )
            cout << "YES\n";
        else
            cout << "NO\n";
    }
    return 0;
}

C++: #include<iostream>
#include<math.h>
using namespace std;
struct vect{
  double x,y;
};
double leng(vect a,vect b){
  return sqrt((a.x - b.x)*(a.x - b.x)+(a.y - b.y)*(a.y - b.y));
    }
double Sc(vect a,vect b,vect c){
  double S,l1,l2,l3; 
  l1 = leng(a,b);
  l2 = leng(b,c);
  l3 = leng(c,a);
  S = (l1 + l2 + l3) / 2;
  return sqrt(S*(S-l1)*(S-l2)*(S-l3));
  
}

int main(){
  vect a,b,c,p;
  double s1,s2,s3,s;
  while(cin >> a.x >> a.y  >> b.x >> b.y >>c.x >>c.y >> p.x >> p.y){
    s1 = Sc(a,b,p); s2 = Sc(a,p,c); s3 = Sc(p,b,c); 
    s = Sc(a,b,c);
    if( Sc(p,b,c) + Sc(a,p,c) < Sc(a,b,c) ){cout << "YES" << endl;
    }else {cout << "NO" << endl;}
    
  }
}

C++: #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0;i<(n);i++)
typedef complex<double> xy_t;
double cross_product(xy_t a, xy_t b) { return (conj(a) * b).imag(); }
double eps=1e-10;
double x[4], y[4];

int main() {
	while (true) {
		rep(i, 4) 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 + eps) > 0 && (pbc + eps) > 0 && (pca + eps) > 0) || ((pab - eps) < 0 && (pbc - eps) < 0 && (pca - eps) < 0);
		cout << (ok ? "YES" : "NO")<<endl;
	}
	return 0;	
}