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;

float KXmax(float x[3]){
	float max=x[0];
	if(max<x[1]){
		max=x[1];
	}
	if(max<x[2]){
		max=x[2];
	}
	return max;
}

float KXmin(float x[3]){
	float min=x[0];
	if(min>x[1]){
		min=x[1];
	}
	if(min>x[2]){
		min=x[2];
	}
	return min;
}

float KYmax(float y[3]){
	float max=y[0];
        if(max<y[1]){
		max=y[1];
	}
	if(max<y[2]){
		max=y[2];
	}
	return max;
}

float KYmin(float y[3]){
	float min=y[0];
	if(min>y[1]){
		min=y[1];
	}
	if(min>y[2]){
		min=y[2];
	}
	return min;	
}

int main()
{
	float x[3],y[3],p1,p2,Xmax,Xmin,Ymax,Ymin;
	
	for(int i=1;i<=100;i++){
		cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>p1>>p2;
		Xmax=KXmax(x);		
		Xmin=KXmin(x);
		Ymax=KYmax(y);
		Ymin=KYmin(y);
		
		if((Xmin<p1&&Xmax>p1) && (Ymin<p2&&Ymax>p2)){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
		
	}
		
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <math.h>

using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)

bool judge(double x[3], double y[3]) {
	double rad1 = atan2(y[0], x[0]);
	double rad2 = atan2(y[1], x[1]);
	double rad3 = atan2(y[2], x[2]);
	if(rad3 < rad1 && rad2 < rad3 || rad1 < rad3 && rad3 < rad2) 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\n", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
		double x[3], y[3];
		x[0] = x2 - x1;
		y[0] = y2 - y1; 
		x[1] = x3 - x1;
		y[1] = y3 - y1;
		x[2] = xp - x1;
		y[2] = yp - y1;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			break;
		}
		x[0] = x1 - x2;
		y[0] = y1 - y2;
		x[1] = x3 - x2;
		y[1] = y3 - y2;
		x[2] = xp - x2;
		y[2] = yp - y2;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			break;
		}
		cout << "YES" << endl;
	}
	return 0;
}

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

using namespace std;

double get2pDist(double, double, double, double);
double getplDist(double, double, double, double, double, double);
double getTriangle(double, double, double, double, double, double);

int main(){
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
		double S = getTriangle(x1, y1, x2, y2, x3, y3);
		double s =
			getTriangle(x1, y1, x2, y2, xp, yp)
			+ getTriangle(x2, y2, x3, y3, xp, yp)
			+ getTriangle(x3, y3, x1, y1, xp, yp);
		abs(S - s) < 0.0001 ? cout << "YES" : cout << "NO";
	}
	return 0;
}

double get2pDist(double x1, double y1, double x2, double y2){
	return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));	
}

double getplDist(double x, double y, double x1, double y1, double x2, double y2){
	double a, b, c;
	a = y1 - y2;
	b = x2 - x1;
	c = x1 * y2 - x2 * y1;
	return abs(a * x + b * y + c) / sqrt(a * a + b * b);
}

double getTriangle(double x1, double y1, double x2, double y2, double x3, double y3){
	return (get2pDist(x1, y1, x2, y2)
	 * getplDist(x3, y3, x1, y1, x2, y2)) / 2;
}

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

double x[4],y[4];
string judge ();

int main() {
	while ( cin >> x[0] ) {
		for( int i = 0; i < 4; i++ ){
			if ( !i )
				cin >> y[i];
			else
				cin >> x[i] >> y[i];
		}
		
		cout << endl <<  judge () << endl;
		
	}
	return 0;
}

string judge () {
	string res;
	
	for ( int i = 0; i < 3; i++ ){
		int next;
		if ( i == 2 ) 
			next = '0';
		else
			next = i + 1;
		if ( x[i] < x[next] && x[i] > x[3] || x[i] > x[next] && x[i] < x[3] )
			return "NO";
		if ( y[i] < y[next] && y[i] > y[3] || y[i] > y[next] && y[i] < y[3] )
			return "NO";
	}
	return "YES";
}