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++: /*
C++ ???????????????????????????????????¬??????
??????AOJ-ITP1??????????????????
*/
#define _USE_MATH_DEFINES

#include <iostream> // ?¨??????\??????
#include <fstream>  // ??????????????\??????
#include <string>   // ???????????¢???
#include <vector>   // ???????????????
#include <cmath>    // ??°??????
#include <iomanip>  // stream???????????¢???
#include <algorithm>// max??¢??°??????

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;        // ????´???°????????????????????????
using std::fixed;         // ???????????????????¨???????????????????????????????
using std::setprecision;  // ?????°????°???°?????\???????????°????????????????????¨????????\???

double dUnitVec(double v1, double v2) {
	return v2 - v1;
}
// ?????¨??§??????????????§????????????????????°???????????°???????????????
int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;

	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
	{
		// 1???????????????????±???????
		// 1-2
		double UnitX1 = x2 - x1;
		double UnitY1 = y2 - y1;

		double UnitX1P = xp - x1;
		double UnitY1P = yp - y1;


		// 2-3
		double UnitX2 = x3 - x2;
		double UnitY2 = y3 - y2;

		double UnitX2P = xp - x2;
		double UnitY2P = yp - y2;

		// 3-1
		double UnitX3 = x1 - x3;
		double UnitY3 = y1 - y3;

		double UnitX3P = xp - x3;
		double UnitY3P = yp - y3;

		// ??????
		double CP1 = UnitX1 * UnitY1P - UnitY1 * UnitX1P;
		double CP2 = UnitX2 * UnitY2P - UnitY2 * UnitX2P;
		double CP3 = UnitX3 * UnitY3P - UnitY3 * UnitX3P;

		// ?????????????????????????¬????????????´???????????????????¢??????????
		if ((CP1 > 0 && CP2 > 0 && CP3 > 0) || (CP1 < 0 && CP2 < 0 && CP3 < 0))
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  double p[4][2],m[2][2],mi[2][2],det,x[2],a[2];
  while(cin >>p[0][0]>>p[0][1]>>p[1][0]>>p[1][1]>>p[2][0]>>p[2][1]>>p[3][0]>>p[3][1]){
    for(int i=1; i<4; i++) for(int j=0; j<2; j++) p[i][j]-=p[0][j];
    for(int i=0; i<2; i++) for(int j=0; j<2; j++) m[i][j] = p[j+1][i];
    for(int i=0; i<2; i++) x[i] = p[3][i];
    det = m[0][0]*m[1][1]-m[0][1]*m[1][0];
    mi[0][0] = m[1][1]/det;
    mi[0][1] = -m[0][1]/det;
    mi[1][0] = -m[1][0]/det;
    mi[1][1] = m[0][0]/det;
    for(int i=0; i<2; i++) a[i] = mi[i][0]*x[0]+mi[i][1]*x[1];
    if(a[0]>0 && a[1]>0 && a[0]+a[1]<1) cout <<"YES"<<endl;
    else cout <<"NO"<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
#define EPS 10e-12
using namespace std;
double heron(double a,double b,double c){
  double s = (a+b+c)/2;
  return sqrt(s*(s - a)*(s - b)*(s - c));
}

int main(){
  double x[4],y[4];
  while(cin >> x[0]){
    cin >>y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];
    double A,B,C;
    A = sqrt(pow(x[2] - x[1],2)+pow(y[2] - y[1],2));
    B = sqrt(pow(x[2] - x[0],2)+pow(y[2] - y[0],2));
    C = sqrt(pow(x[1] - x[0],2)+pow(y[1] - y[0],2));

    double S1 = heron(A,B,C);

    double XA,XB,XC;
    XA = sqrt(pow(x[3] - x[0],2)+pow(y[3] - y[0],2));
    XB = sqrt(pow(x[3] - x[1],2)+pow(y[3] - y[1],2));
    XC = sqrt(pow(x[3] - x[2],2)+pow(y[3] - y[2],2));

    double S2 = heron(XA,XB,C) + heron(XA,XC,B) + heron(XB,XC,A);
    if(fabs(S1-S2) < EPS)cout <<"YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <vector>

using namespace std;

bool checker(double a, double b,double x, double y, double px, double py);

double calc_slope(double x1, double y1, double x2, double y2);

int main(){
  double x1,y1,x2,y2,x3,y3,xp,yp;
  bool flag = true;
  string s="";
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){

    double a1, a2, a3, b1, b2, b3;

    a1 = calc_slope(x1,y1,x2,y2);
    b1 = -a1*x1+y1;
    flag &= checker(a1,b1,x3,y3,xp,yp);

    a2 = calc_slope(x2,y2,x3,y3);
    b2 = -a2*x2+y2;
    flag &= checker(a2,b2,x1,y1,xp,yp);

    a3 = calc_slope(x3,y3,x1,y1);
    b3 = -a3*x3+y3;
    flag &= checker(a3,b3,x2,y2,xp,yp);

    if(flag){
      s += "YES\n";
    }else{
      s += "NO\n";
    }
  }
  cout << s;
}

bool checker(double a, double b, double ox, double oy, double px, double py){ 
  if(a == 0){
    if(b <= ox && b <= px){
      return true;
    }
    else if(b > ox && b > px){
      return true;
    }
  }

  if(oy <= a*ox+b && py <= a*px+b){
    return true;
  }
  else if(oy > a*ox+b && py > a*px+b){
    return true;
  }
  else{
    return false;
  }
}

double calc_slope(double x1, double y1, double x2, double y2){
  if(x1 > x2){
    return (y1-y2)/(x1-x2);
  }else if(x1 < x2){
    return (y2-y1)/(x2-x1);
  }else{
    return 0;
  }
}

C++: #include<iostream>
#include<math.h>
#include<stdlib.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.00001) cout << "YES" << endl;
    else cout << "NO" << endl;

}

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

float S(float a, float b, float c, float d, float e, float f) {
	float ans;
	ans = abs((a - e) * (d - f) - (b - f) * (c - e))/2;
	return ans;
}

int main(){
	float x[4], y[4], SS, SSS;

	while(true){
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];
		if (cin.eof()) { break; }
		SS = S(x[0], y[0], x[1], y[1], x[3], y[3]) + S(x[0], y[0], x[2], y[2], x[3], y[3]) + S(x[1], y[1], x[2], y[2], x[3], y[3]);
		SSS = S(x[0], y[0], x[1], y[1], x[2], y[2]);
		if (SS == SSS) { cout << "YES" << endl; }
		else { cout << "NO" << endl; }
	}
	return 0;
}