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;
double cross(double x1, double y1, double x2, double y2){
	return (x1 * y2) - (y1 * x2);
}
int main(){
	double x[3], y[3], x, y;
	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> px >> py){
		double ret[3];
		for(int i = 0; i < 3; ++i ){
			int n =( i+1 ) % 3;
			ret[i] = cross( px - x[i], py - y[i], x[n] - x[i], y[n] - y[i] );
		}
		if(ret[0] < 0 && ret[1] < 0 && ret[2] < 0 
		|| ret[0] > 0 && ret[1] > 0 && ret[2] > 0) 
			cout << "YES" << endl;
		else
		    cout << "NO" << endl;		
	}
}

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() {
		cout << atan2(0,-1);
		double x1, y1, x2, y2, x3, y3, xp, yp;
		while(scanf("%f %f %f %f %f %f %f %f", &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;
				continue;
			}
			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;
				continue;
			}
			cout << "YES" << endl;
		}
		return 0;
	}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	
	double x1;
	while(cin>>x1){
		double x[3],y[3],px,py;
		x[0]=x1;
		cin>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>px>>py;
		double c[3];
		for(int i=0;i<3;i++){
			double vx1 = x[(i+1)%3]-x[i],vy1 = y[(i+1)%3]-y[i];
			double vx2 = px-x[i],vy2 = py-y[i];
			c[i] = vx1*vy2-vy1*vx2;
		}
		if((c[0]>0&&c[1]>0&&c[2]>0)||(c[0]<0&&c[1]<0&&c[2]<0)) out("YES");
		else out("NO");
	}

	return 0;
}

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

typedef complex<double> P;
#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) <EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

double cross(P a, P b) {
	  return (a.real() * b.imag() - a.imag() * b.real());
}

// a1,a2ツづーツ端ツ点ツづつキツづゥツ静シツ閉ェツづ1,b2ツづーツ端ツ点ツづつキツづゥツ静シツ閉ェツづ個古ーツ債キツ板サツ津ィ
int is_intersected_ls(P a1, P a2, P b1, P b2) {
	  return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
		           ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}

int main(void){
	P A,B,C,P;
	
	while(cin>>A.real()>>A.imag()>>B.real()>>B.imag()>>C.real()>>C.imag()>>P.real()>>P.imag()){
		if(is_intersected_ls(A,P,B,C)){
			cout<<"NO"<<endl;
			continue;
		}
		if(is_intersected_ls(B,P,A,C)){
			cout<<"NO"<<endl;
			continue;
		}
		if(is_intersected_ls(C,P,A,B)){
			cout<<"NO"<<endl;
			continue;
		}
		cout<<"Yes"<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define EPS (1e-10)
#define equal(a,b) (fabs((a)-(b)) < EPS)

class Point{
public:
  double x,y;

  Point(double x = 0, double y = 0): x(x),y(y){}

  Point operator + (Point p){
    return Point( x+p.x , y+p.y );
  }
  Point operator - (Point p){
    return Point( x-p.x , y-p.y );
  }
  Point operator * (double a){
    return Point( a*x , a*y );
  }

  double abs(){
    return sqrt(norm());
  }
  double norm(){
    return x*x+y*y;
  }

  bool operator < (const Point &p)const{
    return x != p.x ? x < p.x : y < p.y;
  }

  bool operator == (const Point &p)const{
    return equal( x-p.x , y-p.y );
  }
};

typedef Point Vector;

double dot(Vector a,Vector b){
  return a.x*b.x + a.y*b.y;
}

double cross(Vector a,Vector b){
  return a.x*b.y - b.x*a.y;
}

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

int ccw( Point p0 , Point p1 , Point p2 ){
  Vector a = p1 - p0;
  Vector b = p2 - p0;
  if( cross(a,b) > EPS ) return COUNTER_CLOCKWISE;
  if( cross(a,b) < -EPS ) return CLOCKWISE;
  if( dot(a,b) < -EPS ) return ONLINE_BACK;
  if( a.norm() < b.norm() ) return ONLINE_FRONT;
  return ON_SEGMENT;
}

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

  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    int a = ccw(Point(x1,y1),Point(x2,y2),Point(xp,yp));
    int b = ccw(Point(x2,y2),Point(x3,y3),Point(xp,yp));
    int c = ccw(Point(x3,y3),Point(x1,y1),Point(xp,yp));

    if(a == b && b == c) cout << "YES" << endl;
    else cout << "NO" << endl;
  }  

  return 0;
}

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

int main() {
    float x1, x2, x3, y1, y2, y3, 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;
    }
    return 0;
}

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;
	double a,b;
	int n,nn;
	
	for ( int i = 0; i < 3; i++ ) {
		if ( i == 2 ){
			n = '0';
			nn = n + 1;
		}else if ( i == 1 ){
			n = i + 1;
			nn = '0';
		}else{
			n = i + 1;
			nn = n + 1;
		}
		
		if ( x[n] != x[i] ){
			a = (y[n] - y[i]) / (x[n] - x[i]);
			b = (x[i] * y[n] - x[n] * y[i]) / (x[i] - x[n]);
			
			if ( (a * x[3] + b) > y[3] && (a * x[nn] + b) < y[nn] || (a * x[3] + b) < y[3] && (a * x[nn] + b) > y[nn] ) {
				return "NO";
			}
		} else {
			
			if ( x[3] < x[i] && x[nn] > x[i] || x[3] > x[i] && x[nn] < x[i] )
				return "NO";
		}
		
	}
	return "YES";
	
}