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<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
double x[4],y[4];
while(cin>>x[0]>>y[0]){
  rep(i,3)cin>>x[i+1]>>y[i+1];
  double s123,s12p,s13p,a;
  s123=(x[1]-x[0])*(y[2]-y[0])-(y[1]-y[0])*(x[2]-x[0]);
  s12p=(x[1]-x[0])*(y[3]-y[0])-(y[1]-y[0])*(x[3]-x[0]);
  s13p=(x[3]-x[0])*(y[2]-y[0])-(y[3]-y[0])*(x[2]-x[0]);
  
  a=(s12p+s13p)/s123;
  
  if(s123*s12p>0&&s123*s13p>0&a>0&&a<1)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  }
}

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

int main(){

	double x[3],y[3],px,py,x1,x2,y1,y2,f;
	int f3,i;
		
	while(scanf_s("%f%f%f%f%f%f%f%f",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&px,&py)>0){
		f3=0;
		for(i=0;i<3;i++){
			x1=x[i];
			y1=y[i];
			x2=x[(i+1)%3];
			y2=y[(i+1)%3];
			f=x1*(py-y2)+px*(y2-y1)+x2*(y1-py);
			if(f>0){
				f3++;
			}else if(f<0){
				f3--;
			}
			cout << f << endl;
		}
		if(abs(f3)==3)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

C++: //
//  practise.h
//  c++practise
//
//  Created by Ubnit04 on 2015/06/10.
//
//

#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 x1, y1, x2, y2, x3, y3, xp, yp;

    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        if (
                (
                    ((x1 < xp && xp < x2) || (x2 < xp && xp < x1)) &&
                    ((y1 < yp && yp < y2) || (y2 < yp && yp < y1))
                ) || (
                    ((x2 < xp && xp < x3) || (x3 < xp && xp < x2)) &&
                    ((y2 < yp && yp < y3) || (y3 < yp && yp < y2))
                ) || (
                    ((x3 < xp && xp < x1) || (x1 < xp && xp < x3)) &&
                    ((y3 < yp && yp < y1) || (y1 < yp && yp < y3))
                )
           ) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

    return 0;
}

C++: #include <iostream>
#include <cmath>
#define EPS (1.0e-8)

using namespace std;

int main()
{
	double x1, y1, x2, y2, x3, y3, xp, yp;
	double a[2], b[2], A, B;
	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		a[0] = x2 - x1;
		a[1] = y2 - y1;
		b[0] = x3 - x1;
		b[1] = y3 - y1;
		if(fabs(a[0] * b[0] + a[1] * b[1]) != 1) {
			A = (b[1] * (xp - x1) - b[0] * (yp - y1)) / (a[0] * b[1] - b[0] * a[1]);
			B = (a[1] * (xp - x1) - (yp - y1) * a[0]) / (a[1] * b[0] - b[1] * a[0]);
			cout << (((A+B < 1) && (A > 0) && (B > 0)) ? "YES" : "NO") << endl;
		}
	}
}