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<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
double check(double xa,double ya,double xb,double yb,double xc,double yc);
int main(void){
    double qxa,qya,qxb,qyb,qxc,qyc,qxp,qyp;
	while(cin>>qxa){

	    cin>>qya>>qxb>>qyb>>qxc>>qyc>>qxp>>qyp;
	    double abc,abp,bcp,cap;
	    abc=check(qxa,qya,qxb,qyb,qxc,qyc);
	    abp=check(qxa,qya,qxb,qyb,qxp,qyp);
        bcp=check(qxb,qyb,qxc,qyc,qxp,qyp);
        cap=check(qxc,qyc,qxa,qya,qxp,qyp);

        double var=abc-(abp+bcp+cap);
        if(var<=0.01&&var>=-0.01)var=0.0;
        if(var==0.0)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;


	}
	return 0;
}


double check(double xa,double ya,double xb,double yb,double xc,double yc){

    double ab,bc,ca;
    double S,s;
    ab=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
    bc=sqrt((xb-xc)*(xb-xc)+(yb-yc)*(yb-yc));
    ca=sqrt((xc-xa)*(xc-xa)+(yc-ya)*(yc-ya));
    s=0.5*(ab+bc+ca);
    S=sqrt(s*(s-ab)*(s-bc)*(s-ca));
    //cout<<S<<endl;
    return S;


}

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

using namespace std;

int main(){

	double x1,y1,x2,y2,x3,y3,xp,yp;

	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		complex<double> p1(x1,y1);
		complex<double> p2(x2,y2);
		complex<double> p3(x3,y3);
		
		// p1_2xNgÆp1_3xNgðßA»êçÅpxNgð çíµ½Æ«ÌWÅ»f
		complex<double> p12 = -p1 + p2;
		complex<double> p13 = -p1 + p3;

		double a = (xp - (p13.real()*yp)/p13.imag())/(p12.real() - (p13.real()*p12.imag())/(p13.imag()));
		double b = (yp - a*p12.imag())/p13.imag();
		if(a >= 0 && b >= 0 && a + b < 1)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <math.h>
#define EPS (1e-6)
using namespace std;

double tri (double a, double b, double c) {
    double s = (a + b + c) * 0.5;
    double res = sqrt(s * (s - a) * (s - b) * (s - c));
    return res;
}

int main ()
{
    double x1, x2, x3, y1, y2, y3, xp, yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        double a = hypot(x2 - x1, y2 - y1);
        double c = hypot(x3 - x1, y3 - y1);
        double b = hypot(x3 - x2, y3 - y2);
        double x = hypot(xp - x1, yp - y1);
        double y = hypot(xp - x2, yp - y2);
        double z = hypot(xp - x3, yp - y3);

        if (tri(a, x, y) + tri(b, y, z) + tri(c, x, z) - tri(a, c, b) < EPS) cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}

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