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

C++: #include<iostream>
#include<cmath>
#include<algorithm>
#include<utility>
using namespace std;
double x,y;
bool cross(double a,double b,double c,double d)
{
	return (c-a)*(y-b)-(x-a)*(d-b)>0;
}
int main()
{
	double a,b,c,d,e,f;
	for(;cin>>a>>b>>c>>d>>e>>f>>x>>y;)
	{
		int cnt=0;
		cnt+=cross(a,b,c,d);
		cnt+=cross(c,d,e,f);
		cnt+=cross(e,f,a,b);
		cout<<(cnt==0||cnt==3?"YES":"NO")<<endl;
	}
}

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

int main() {
	typedef complex<double> com;
	double x1, y1, x2, y2, x3, y3, xp, yp, s1, s2, s3;
	while ( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp ) {
		s1 = ( conj( com( x1 - xp, y1 - yp ) ) * com( x2 - xp, y2 - yp ) ).imag();
		s2 = ( conj( com( x2 - xp, y2 - yp ) ) * com( x3 - xp, y3 - yp ) ).imag();
		s3 = ( conj( com( x3 - xp, y3 - yp ) ) * com( x1 - xp, y1 - yp ) ).imag();
		if ( s1 * s2 > 0 && s2 * s3 > 0 && s3 * s1 > 0 )
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}

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

using namespace std;

//float getSquare(float x1, float y1, float x2, float y2, float x3, float y3)
//{
//    float xAB, yAB;
//    float xBC, yBC;
//
//    xAB = x2 - x1;
//    yAB = y2 - y1;
//
//    xBC = x3 - x2;
//    yBC = y3 - y2;
//    
//    return fabs((xAB * yBC - yAB * xBC) / 2.0f); //square of tri-angle
//    
//}
//
//void isIn()
//{
//    float x1, y1;
//    float x2, y2;
//    float x3, y3;
//    float xp, yp;
//    
//    float sABC, sABP, sACP, sBCP;
//    
//    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
//    {
//        sABC = getSquare(x1, y1, x2, y2, x3, y3);
//        sABP = getSquare(x1, y1, x2, y2, xp, yp);
//        sBCP = getSquare(x2, y2, x3, y3, xp, yp);
//        sACP = getSquare(x1, y1, x3, y3, xp, yp);
//        
//        if((sABC > 0) && (sBCP > 0) && (sACP > 0))
//        {
//            if (sABC == sABP + sACP + sBCP) //if p is including triangle this should be worked
//            {
//                cout<<"YES"<<endl;
//            }
//            else if (sABC < sABP + sACP + sBCP)
//            {
//                cout<<"NO"<<endl;
//            }
//        }
//    }
//    
//    return;
//}

void isIn()
{
    float x1, y1;
    float x2, y2;
    float x3, y3;
    float xp, yp;
    
    float a, b, c;
    
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
    {
        a = (x3 - x2) * (yp - y2) - (y3 - y2) * (xp - x2);
        b = (x1 - x3) * (yp - y3) - (y1 - y3) * (xp - x3);
        c = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1);
        
        if((a >= 0 && b  >= 0 && c >= 0) || (a <= 0 && b <= 0 && c <= 0))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
}

int main()
{
    isIn();
    return 0;
}

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

int main(){
	double x[3],y[3],xp,yp;
	while(cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>xp>>yp){
		bool ans=true;
		//xが一番小さい点と大きい点を見つける
		int Xmin=0,Xmax=0;
		double tan[2],tanP;
		
		int k=0;
		int Yflg=0; //xの値が同じだった場合、自分よりyが大きい場合１、小さい場合−１とする
		
		for(int i=1;i<3;i++){
			if(x[Xmin]>x[i]) Xmin=i;
			if(x[Xmax]<x[i]) Xmax=i;
		}
		//x座標の一番小さい点とそれ以外の点との傾き(tan)を求める
		for(int i=0;i<3;i++){
			if(i!=Xmin){
				if(x[i]==x[Xmin]){ //もしxの一番小さい点が2つあった場合
					if(y[i]>y[Xmin]) Yflg=1;
					if(y[i]<y[Xmin]) Yflg=-1;
				}else{ //それ以外
					tan[k++]=(y[i]-y[Xmin])/(x[i]-x[Xmin]);
				}
			}
		}
		if(xp<=x[Xmin]){ //点pのxが一番小さなx以下の場合、三角形の中にpは入っていない
			ans=false;
		}else{ //それ以外
			tanP=(yp-y[Xmin])/(xp-x[Xmin]);
		}
		//点Pとの角度が他の2点の間にない場合、pは三角形の中には入っていない
		if((Yflg==0) && !((tan[0]<tanP && tan[1]>tanP)||(tan[1]<tanP && tan[0]>tanP))){
			ans=false;
		}else if((Yflg==1) && !(tan[0]<tanP)){
			ans=false;
		}else if((Yflg==-1) && !(tan[0]>tanP)){
			ans=false;
		}

		//x座標の一番大きい点とそれ以外の点との傾き(tan)を求める
		k=0; Yflg=0;
		for(int i=0;i<3;i++){
			if(i!=Xmax){
				if(x[i]==x[Xmax]){ //もしxの一番小さい点が2つあった場合
					if(y[i]>y[Xmax]) Yflg=1;
					if(y[i]<y[Xmax]) Yflg=-1;
				}else{ //それ以外
					tan[k++]=(y[i]-y[Xmax])/(x[Xmax]-x[i]);
				}
			}
		}
		if(xp>=x[Xmax]){ //点pのxが一番大きなx以上の場合、三角形の中にpは入っていない
			ans=false;
		}else{ //それ以外
			tanP=(yp-y[Xmax])/(x[Xmax]-xp);
		}
		//点Pとの角度が他の2点の間にない場合、pは三角形の中には入っていない
		if((Yflg==0) && !((tan[0]<tanP && tan[1]>tanP)||(tan[1]<tanP && tan[0]>tanP))){
			ans=false;
		}else if((Yflg==1) && !(tan[0]<tanP)){
			ans=false;
		}else if((Yflg==-1) && !(tan[0]>tanP)){
			ans=false;
		}

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

C++: #include <iostream>
#include <cmath>
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]>>y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3]){
  
    double A,B,C;
    A = sqrt(pow(x[0] - x[1],2)+pow(y[0] - y[1],2));
    B = sqrt(pow(x[0] - x[2],2)+pow(y[0] - y[2],2));
    C = sqrt(pow(x[2] - x[1],2)+pow(y[2] - y[1],2));

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

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

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

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

using namespace std;
const double eps = 1e-11;

typedef complex<double> xy_t;

double dotProduct(xy_t a, xy_t b){
	return (conj(a) * b).real();
}

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

xy_t projection(xy_t p, xy_t b){
	return b*dotProduct(p,b)/norm(b);
}

bool cmpSign(double a, double b){
	if((a > 0 && b < 0) || (a < 0 && b > 0)) return false;
	return true;
}

int main (){
	int N;
	double X[4],Y[4];
	while(true){
		for(int i = 0; i < 4; i++) cin >> X[i] >> Y[i];
		if (!cin) break;
		xy_t a[4];
		for(int i = 0; i < 4; i++) a[i] = xy_t(X[i],Y[i]);
		double p = crossProduct(a[0]-a[3],a[1]-a[3]);
		double q = crossProduct(a[1]-a[3],a[2]-a[3]);
		double r = crossProduct(a[2]-a[3],a[0]-a[3]);
		bool ok = cmpSign(p,q) && cmpSign(q,r) && cmpSign(r,p);
		cout << (ok ? "YES" : "NO") << endl;
	}
	return 0;
}