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 <math.h>
#include <stdio.h>
using namespace std;
double x,y,t=0.001;

double ka(double a,double b,double c,double d) {
	double e,f,g;
	e=sqrt((a-c)*(a-c)+(b-d)*(b-d));
	f=sqrt((a-x)*(a-x)+(b-y)*(b-y));
	g=sqrt((c-x)*(c-x)+(d-y)*(d-y));
	return 180*acos((f*f+g*g-e*e)/(2*f*g))/3.141592;
}

int main() {
	double s,a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f >> x >> y) {
    s=ka(a,b,c,d)+ka(c,d,e,f)+ka(a,b,e,f);
	if (360-t<s && 360+t>s) cout << "YES" << endl; else cout << "NO" << endl;
	}
	return 0;
}

C++: #include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>

#define REP(i,s,e) for(int i=int(s);i<int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

#define EPS 1e-6

using namespace std;

bool intriangle(double x1,double y1,double x2,double y2,double x3,double y3,double xp,double yp){

double a=y2-y1;
double b=x1-x2;
double c=y1*(x2-x1)-x1*(y2-y1);

if((a*xp+b*yp+c)*(a*(x1+x2+x3)+b*(y1+y2+y3)+3*c)>0)
return true;
else
return false;
}

int main(){

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

while(true){

cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;

if(cin.fail()) break;

if(intriangle(x1,y1,x2,y2,x3,y3,xp,yp) && intriangle(x2,y2,x3,y3,x1,y1,xp,yp) && intriangle(x3,y3,x1,y1,x2,y2,xp,yp))
cout << "YES" << endl;
else cout << "NO" << endl;

}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

typedef struct{

  double x,y;
}vec_t;

int main(){

  double x1,y1,x2,y2,x3,y3,xp,yp;
  vec_t AB,BC,CA,AP,BP,CP;

  while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){

    AB.x=x2-x1 , AB.y=y2-y1;
    BC.x=x3-x2 , BC.y=y3-y2;
    CA.x=x1-x3 , CA.y=y1-y3;
    AP.x=xp-x1 , AP.y=yp-y1;
    BP.x=xp-x2 , BP.y=yp-y2;
    CP.x=xp-x3 , CP.y=yp-y3;

    double c1=AB.x*BP.y - AB.y*BP.x;
    double c2=BC.x*CP.y - BC.y*CP.x;
    double c3=CA.x*AP.y - CA.y*AP.x;

    if((c1<0&&c2<0&&c3<0) || (c1>0&&c2>0&&c3>0))cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }

  return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){

    double x[4],y[4];
    while(true){
	REP(i,4) {
	    cin >> x[i];
	    if(cin.eof()) return 0;
	    cin >> y[i];
	}
	double s,t;
	double m = 0;
	bool flg = false;
	    double x1[] =  {x[2] - x[0],  x[1] - x[0]};
	    double y1[] = { y[2] - y[0] , y[1] - y[0]};
	    double x2 = x[3] - x[0];
	    double y2 = y[3] - y[0];
	    REP(i,1e3){
		REP(j,1e3){
		s = (double)i / 1e3;
		t = (double)j / 1e3;
		if(s + t > 1) break;
		if(s * x1[0] + t * x1[1] - x2 < 1e-4 && s * y1[0] + t * y1[1] - y2 < 1e-4){
		    flg = true;
		    break;
		}
	    }
		if(flg) break;
	    }
	    if(flg) cout << "YES" << endl;
	    else cout << "NO" << endl;

    }

    return 0;
}

C++: #include <iostream>

template <class T>
struct vec {
  T x, y;
  vec(const T& _x, const T& _y) : x(_x), y(_y) {}
  vec<T> operator+(const vec<T>& rhs) const {
    return vec<T>(x + rhs.x, y + rhs.y);
  }
  vec<T> operator-(const vec<T>& rhs) const {
    return vec<T>(x - rhs.x, y - rhs.y);
  }
};

using namespace std;

int main(int ac, char **av) {
  float x1, x2, x3, y1, y2, y3, xp, yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    vec<float> T1 {x1, y1};
    vec<float> T2 {x2, y2};
    vec<float> T3 {x3, y3};
    vec<float> Tp {xp, yp};

    auto ab = T2 - T1;
    auto bp = Tp - T2;
    auto bc = T3 - T2;
    auto cp = Tp - T3;
    auto ca = T1 - T3;
    auto ap = Tp - T1;

    auto c1 = ab.x * bp.y - ab.y * bp.x;
    auto c2 = bc.x * cp.y - bc.y * cp.x;
    auto c3 = ca.x * ap.y - ca.y * ap.x;

    if ((c1 > 0 && c2 > 0 && c3 > 0) || (c1 < 0 && c2 < 0 && c3 < 0)) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define fs first
#define sc second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define pb emplace_back

using pii = pair<int, int>;
using vi = vector<int>;
using lint = long long;

const int inf = 1001001001;
const lint linf = 1001001001001001001ll;
const int mod = 1e9 + 7;
const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1};

template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; } return a > b; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; } return a < b; }
template<typename T> inline void print(const T &x, string s = "\n") { cout << x << s; }
template<typename T> inline void print(const vector<T> &v, string s = " ") 
{ rep(i, v.size()) cout << v[i] << (i + 1 == v.size() ? "\n" : s); }
inline bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; }
inline lint in() { lint x; std::cin>>x; return x; }

#define X real()
#define Y imag()
typedef complex<double> P;
const double EPS = 1e-10;

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

bool is_intersected(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() {
	double latte[4], beet[4];
	while (cin >> latte[0]) {
		rep(i, 4) {
			if (i == 0) cin >> beet[0];
			else cin >> latte[i] >> beet[i];
		}

		P a[3], r;

		rep(i, 3) {
			a[i] = P(latte[i], beet[i]);
		}

		r = P(latte[3], beet[3]);

		int cnt = 0;
		rep(i, 3) {
			cnt += is_intersected(a[i], a[(i + 1) % 3], r, P(100.1, 100.1));
		}

		cout << (cnt & 1 ? "YES" : "NO") << endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <sstream>
#include <cstdlib>
#include <cmath>
 
using namespace std;

int checkPoint(double x1, double y1, double x2, double y2, double x, double y){
    if(x1 - x2 == 0) { if(x1 - x == 0) return 0; if(x - x1 > 0) { return 1; } else return -1; }
    if((y - y1) - (y2 - y1) / (x2 - x1) * (x - x1) == 0) return 0;
    if((y - y1) - (y2 - y1) / (x2 - x1) * (x - x1) > 0) { return 1; } else return -1;
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    bool f;
    while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
        f = false;
        if(checkPoint(x1, y1, x2, y2, x3, y3) * checkPoint(x1, y1, x2, y2, xp, yp) == 1){
            if(checkPoint(x1, y1, x3, y3, x2, y2) * checkPoint(x1, y1, x3, y3, xp, yp) == 1){
                if(checkPoint(x2, y2, x3, y3, x1, y1) * checkPoint(x2, y2, x3, y3, xp, yp) == 1){ f = true; cout << "YES" << endl; }}}
        if(!f) cout << "NO" << endl;
    }
    return 0;
}