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 <bits/stdc++.h>
using namespace std;
//define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// 許容する誤差ε
#define EPS (1e-10)
// 2つのスカラーが等しいかどうか
#define EQ(a,b) (abs((a)-(b)) < EPS)
// 2つのベクトルが等しいかどうか
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
//template
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << "(" << p.first << "," << p.second << ")";return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if(it != v.begin())os << " ";os << *it;
      }return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp){
  for(auto x: mp)os << "(" << x.first << "," << x.second << ")" << endl;
  return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void PRINTF(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void PRINTF(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}
//typedef
typedef complex<double> Point;
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;



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

vector<Point> vec(3);
Point p;
bool solve(int f){
  bool ans = true;
  rep(i,3){
    Point v = vec[(i+1)%3]-vec[i];
    if(f and cross(v, p-vec[i]) < 0)ans = false;
    if(!f and cross(v, p-vec[i]) > 0)ans = false;
  }
  return ans;
}
signed main(){
  double X[3], Y[3], Xp, Yp;
  while(cin>>X[0]>>Y[0]>>X[1]>>Y[1]>>X[2]>>Y[2]>>Xp>>Yp){
    rep(i,3)vec[i] = Point(X[i], Y[i]);
    p = Point(Xp, Yp);
    if(solve(0) or solve(1))printf("YES\n");
    else printf("NO\n");
  }
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
  double x1,x2,x3,y1,y2,y3,x,y;
  double a,b,c,d,ans;
  while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x,&y)!=EOF){
    a=x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2);
    b=x*(y1-y2)+x1*(y2-y)+x2*(y-y1);
    c=x*(y2-y3)+x2*(y3-y)+x3*(y-y2);
    d=x*(y3-y1)+x3*(y1-y)+x1*(y-y3);
    if((a<0 && b<0 && c<0 && d<0) || (a>0 && b>0 && c>0 && d>0)){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
  return 0;
}

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

using namespace std;
#define EPS (1e-10)
#define ABS(x) ((x)<0?-(x):(x))
struct L{
    L(double xa, double ya, double xb, double yb){
	x1 = xa;
	y1 = ya;
	x2 = xb;
	y2 = yb;
	if(xa-xb == 0){
	    a = 1;
	    b = 0;
	    c = -xa;
	}
	else {
	    a = (ya-yb);
	    b = (xb-xa);
	    c = -(a*xa + b*ya);
	    if(ABS(a*xb+b*yb+c)>EPS)exit(1);
	}
    };
    double f(double x, double y){
	return a*x + b*y + c;
    }
    double a, b, c, x1, x2, y1, y2;//0 = ax + by + c [x1, x2]
};

bool cross(L a, L b){
    return (a.f(b.x1, b.y1) * a.f(b.x2, b.y2) < 0+EPS && 
	    b.f(a.x1, a.y1) * b.f(a.x2, a.y2) < 0+EPS);
}

double x1, y1, x2, y2, x3, y3, xp, yp;

int main(){
    while(cin){
	cin >> x1 >> y1 >> x2 >> y2>> x3 >> y3 >> xp >> yp;
	L a = L(x1, y1, x2, y2);
	L b = L(x1, y1, x3, y3);
	L c = L(x2, y2, x3, y3);
	L p = L(xp, yp, 203, 103.141592);
	int res = 0;
	if(cross(a,p))res++;
	if(cross(b,p))res++;
	if(cross(c,p))res++;
	if(res % 2 == 0)cout << "NO" <<  endl;
	else cout << "YES"<<endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

int main(){
    double x1,y1,x2,y2,x3,y3,xp,yp;
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
    //printf("%lf %lf %lf %lf %lf %lf %lf %lf\n",x1,y1,x2,y2,x3,y3,xp,yp);
        //printf("%s\n",(((x2-x1)*(y2-yp)-(y2-y1)*(x2-xp)>0)==((x3-x2)*(y3-yp)-(y3-y2)*(x3-xp)>0)==((x1-x3)*(y1-yp)-(y1-y3)*(x1-xp)>0))?"YES":"NO");
        //if((((x2-x1)*(y2-yp)-(y2-y1)*(x2-xp)>0)==true)&&(((x3-x2)*(y3-yp)-(y3-y2)*(x3-xp)>0)==true)&&(((x1-x3)*(y1-yp)-(y1-y3)*(x1-xp)>0)==true)){
        //printf("%lf %lf %lf\n",(x2-x1)*(y2-yp)-(y2-y1)*(x2-xp),(x3-x2)*(y3-yp)-(y3-y2)*(x3-xp),(x1-x3)*(y1-yp)-(y1-y3)*(x1-xp));
        if(((x2-x1)*(y2-yp)-(y2-y1)*(x2-xp)>0)&&((x3-x2)*(y3-yp)-(y3-y2)*(x3-xp)>0)&&((x1-x3)*(y1-yp)-(y1-y3)*(x1-xp)>0)){
            printf("YES\n");
        }else if(((x2-x1)*(y2-yp)-(y2-y1)*(x2-xp)<0)&&((x3-x2)*(y3-yp)-(y3-y2)*(x3-xp)<0)&&((x1-x3)*(y1-yp)-(y1-y3)*(x1-xp)<0)){
            printf("YES\n");
        }else{
            printf("NO\n");
        }

    }
    return 0;
}

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

float 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++ ){
		if ( x[i] < x[i + 1] && x[i] > x[3] || x[i] > x[i + 1] && x[i] < x[3] )
			return "NO";
		if ( y[i] < y[i + 1] && y[i] > y[3] || y[i] > y[i + 1] && y[i] < y[3] )
			return "NO";
	}
	return "YES";
}