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

#define turn(x1,y1,x2,y2,x3,y3) x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2)
int hantei(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy);
int main()
{
	int i;
	double xy[8];
	int ans;
	char a;
	
	for(;cin >> xy[0];)
	{
		for(i=1;i<8;i++)
			cin >> xy[i] ;
		
		ans=1;
		
		if(hantei(xy[0],xy[1],xy[2],xy[3],xy[4],xy[5],xy[6],xy[7])==0)
			ans=0;
		
		if(ans==1)
			printf("YES\n");
		else
			printf("NO\n");
	}
}

int hantei(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy)
{
	if((
		turn(ax,ay,bx,by,cx,cy)>0.0 &&
		turn(dx,dy,ax,ay,bx,by)>0.0 &&
		turn(dx,dy,bx,by,cx,cy)>0.0 &&
		turn(dx,dy,cx,cy,ax,ay)>0.0)
		||(
		turn(ax,ay,bx,by,cx,cy)<0.0 &&
		turn(dx,dy,ax,ay,bx,by)<0.0 &&
		turn(dx,dy,bx,by,cx,cy)<0.0 &&
		turn(dx,dy,cx,cy,ax,ay)<0.0)
	)
		return 1;
	else
		return 0;
}

C++: #include <iostream>
using namespace std;
struct point{
	double x;
	double y;
};

bool side(point p1, point p2, point p3){
	return (p3.y-p1.y)*(p2.x-p1.x)-(p3.x-p1.x)*(p2.y-p1.y)>0;
}

int main(void){
    point p1, p2, p3, p0;
	
	while (true){
		cin>>p1.x>>p1.y;
		if (cin.eof()) break;
		cin>>p2.x>>p2.y;
		cin>>p3.x>>p3.y;
		cin>>p0.x>>p0.y;

		if (side(p1, p2, p0) == side(p2, p3, p0) && side(p2, p3, p0) == side(p3, p1, p0))
			cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;
	}
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  double a[2],b[2],c[2],r[2];
  while(cin >>a[0]>>a[1]>>b[0]>>b[1]>>c[0]>>c[1]>>r[0]>>r[1]){
    b[0]-=a[0];
    c[0]-=a[0];
    r[0]-=a[0];
    b[1]-=a[1];
    c[1]-=a[1];
    r[1]-=a[1];
    double m[2][2],ans[2],rev[2][2];
    m[0][0] = b[0];
    m[0][1] = c[0];
    m[1][0] = b[1];
    m[1][1] = c[1];
    ans[0] = r[0];
    ans[1] = r[1];
    double det = m[0][0]*m[1][1]-m[0][1]*m[1][0];
    rev[0][0] = m[1][1]/det;
    rev[0][1] = -m[0][1]/det;
    rev[1][0] = -m[1][0]/det;
    rev[1][1] = m[0][0]/det;
    double s = ans[0]*rev[0][0]+ans[1]*rev[0][1];
    double t = ans[0]*rev[1][0]+ans[1]*rev[1][1];
    if(s>0 && t>0 &&s+t<1){cout <<"YES"<<endl;}
    else{cout <<"NO"<<endl;}
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  double x[2],y[2],z[2],p[2];
  while(cin >>x[0]>>x[1]>>y[0]>>y[1]>>z[0]>>z[1]>>p[0]>>p[1]){
    double v[3][2],vp[3][2];
    v[0][0] = y[0]-x[0];
    v[0][1] = y[1]-x[1];
    v[1][0] = z[0]-y[0];
    v[1][1] = z[1]-y[1];
    v[2][0] = x[0]-z[0];
    v[2][1] = x[1]-z[1];
    vp[0][0] = p[0]-x[0];
    vp[0][1] = p[1]-x[1];
    vp[1][0] = p[0]-y[0];
    vp[1][1] = p[1]-y[1];
    vp[2][0] = p[0]-z[0];
    vp[2][1] = p[1]-z[1];
    int n=0;
    for(int i=0; i<3; i++){
      if(v[i][0]*vp[i][1]-v[i][1]*vp[i][0]<0) n--;
      else n++;
    }
    if(n == 3 || n == -3) cout <<"YES"<<endl;
    else cout <<"NO"<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <sstream>
#include <cstdlib>
#include <cmath>
 
using namespace std;

int checkPoint(double x1, double y1, double x2, double y2, double x, double y){
    if(x1 - x2 == 0) if(x - x1 >= 0) { return 1; } else return -1;
    if((y - y1) - (y2 - y1) / (x2 - x1) * (x - x1) >= 0) { return 1; } else return -1;
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
        if(checkPoint(x1, y1, x2, y2, x3, y3) * checkPoint(x1, y1, x2, y2, xp, yp))
            if(checkPoint(x1, y1, x3, y3, x2, y2) * checkPoint(x1, y1, x3, y3, xp, yp))
                if(checkPoint(x2, y2, x3, y3, x1, y1) * checkPoint(x2, y2, x3, y3, xp, yp)) cout << "YES" << endl;
            cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;

double length(double, double, double, double);

double triangle(double x1, double y1, double x2, double y2, double x3, double y3) {
    double a = length(x1, y1, x3, y3);
    double b = length(x2, y2, x3, y3);
    double c = length(x1, y1, x2, y2);

    double d = (a + b - c) / sqrt(a * b) / 2.0; // cos(radian)

    // cout << d << endl;

    return d;
}

double length(double x, double y, double ox, double oy) {
    return pow(x - ox, 2) + pow(y - oy, 2);
}

int main() {
    double x1, y1, x2, y2, x3, y3, xp, yp;

    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        double ta = triangle(x1, y1, x2, y2, xp, yp);
        double tb = triangle(x1, y1, x3, y3, xp, yp);
        double tc = triangle(x2, y2, x3, y3, xp, yp);

        if (ta < 0 && tb < 0 && tc < 0) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

    return 0;
}