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;

bool is_up (double x1, double y1, double x2, double y2, double px, double py) {
    if (x1 == x2) return px > x1;
    return (py > (y2 - y1) / (x2 - x1) * px + (x1 * y2 - x2 * y1) / (x1 - x2) );
}

int main() {
    double x1,y1,x2,y2,x3,y3,xp,yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        int up = 0;
        up += is_up(x1, y1, x2, y2, xp, yp);
        cout << up << endl;
        up += is_up(x3, y3, x2, y2, xp, yp);
        cout << up << endl;
        up += is_up(x1, y1, x3, y3, xp, yp);
        cout << up << endl;

        if (up == 1) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <complex>
//#include <fstream>

using namespace std;

typedef complex <double> P;

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)

// OÏ (cross product) : a~b = |a||b|sinÆ
double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.pt", "r", stdin);
	double x1, y1, x2, y2, x3, y3, xp, yp;

	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp ){
		P a(x1, y1), b(x2, y2), c(x3, y3 ), p(xp, yp);
		
		if ( (cross (p - a, p - b ) > 0. && cross (p - b, p - c ) > 0. && cross (p - c , p - a ) > 0.)
		||   (cross (p - a, p - b ) < 0. && cross (p - b, p - c ) < 0. && cross (p - c , p - a ) < 0.) ) {
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		} // end if
	} // end loop

	return 0;
}

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

double mnk(double a,double b,double c){
  double s = (a + b + c) / 2;
  double S = sqrt(s*(s - a)*(s - b)*(s - c)); //テ」ツδ佚」ツδュテ」ツδウテ」ツ?ョテ・ツ?ャテ・ツシツ?
  return S;
}

int main(){
  double x1,y1,x2,y2,x3,y3,xp,yp;
  
  while( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp ){
    double a = sqrt(pow(x1-x2,2) + pow(y1-y2,2));
    double b = sqrt(pow(x1-x3,2) + pow(y1-y3,2));
    double c = sqrt(pow(x3-x2,2) + pow(y3-y2,2));
    double S1 = mnk(a,b,c);
    
    double x = sqrt(pow(x1-xp,2) + pow(y1-yp,2));
    double y = sqrt(pow(x2-xp,2) + pow(y2-yp,2));
    double z = sqrt(pow(x3-xp,2) + pow(y3-yp,2));
    double S2 = mnk(x,y,a) + mnk(x,z,b) + mnk(y,z,c);
    
    if ((float)S1 == (float)S2){
      printf("YES\n");
    }else{
      printf("NO\n");
    }
    
    
  }
  return 0;
}

C++: #include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, init, n) for(int i = init; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define fi first
#define se second

using namespace std;
using ll = long long int;
using P = pair<double, double>;
using T = tuple<int, int, int>;
using edge = struct
{
    int to, cost;
};

const int MOD = 1e9 + 7;
const int iINF = 1e9;
const long long int llINF = 1e18;
const double PI = acos(-1.0);

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

P sub_vector(P a, P b)
{
    P res;

    res.fi = a.fi - b.fi;
    res.se = a.se - b.se;

    return res;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    double x1, x2, x3, y1, y2, y3, xp, yp;
    
    while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp)
    {
        P AB = sub_vector(P{x2, y2}, P{x1, y1});   
        P BP = sub_vector(P{xp, yp}, P{x2, y2});

        P BC = sub_vector(P{x3, y3}, P{x2, y2});
        P CP = sub_vector(P{xp, yp}, P{x3, y3});

        P CA = sub_vector(P{x1, y1}, P{x3, y3});
        P AP = sub_vector(P{xp, yp}, P{x1, y1});

        double c1 = AB.fi * BP.se - AB.se * BP.fi;
        double c2 = BC.fi * CP.se - BC.se * CP.fi;
        double c3 = CA.fi * AP.se - CA.se * AP.fi;

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

    }
    
    return 0;
}

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

using namespace std;

int main(){

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

	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		complex<double> p1(x1,y1);
		complex<double> p2(x2,y2);
		complex<double> p3(x3,y3);
		
		// p1_2xNgÆp1_3xNgðßA»êçÅpxNgð çíµ½Æ«ÌWÅ»f
		complex<double> p12 = -p1 + p2;
		complex<double> p13 = -p1 + p3;

		double a = (xp - (p13.real()*yp)/p13.imag())/(p12.real() - (p13.real()*p12.imag())/(p13.imag()));
		double b = (yp - a*p12.imag())/p13.imag();
		if(a >= 0 && b >= 0 && a + b <= 1)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main() {
	double x[3], y[3], p, q;
	while (cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>p>>q) {
		bool f = true;
		for (int i = 0; i < 3; i++) {
			if ((x[i % 3] - p)*(y[(i + 1) % 3] - q) - (y[i % 3] - q)*(x[(i + 1) % 3] - p) <= 0)f = false;
		}
		if (f)puts("YES");
		else puts("NO");
	}
	return 0;
}