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 <vector>
#include <cmath>

template <typename T> 
class Point
{
private:
    T x;
    T y;
public:
    Point(T x=0, T y=0): x(x), y(y) {}
    T getx() const {return x;}
    T gety() const {return y;}

    static T norm2(Point<T> a, Point<T> b) 
    {
        return std::pow(a.x-b.x, 2) + std::pow(a.y-b.y, 2);
    }
};

template <typename T>
void distance_argmax(std::vector<Point<T>> ps, int& a, int& b)
{
    T max_d{-1};
    for(int i=0; i<ps.size(); ++i)
    {
        for(int j=i; j<ps.size(); ++j)
        {
           if(i != j)
           {
               T d = Point<T>::norm2(ps[i], ps[j]);
               if(d > max_d)
               {
                   a = i;
                   b = j;
                   max_d = d;
               }
           }
        }
    }
}

int main()
{
    double x{0}; double y{0};
    std::vector<Point<double>> points(4);
    int i = 0;

    while(std::cin >> x >> y)
    {
        int idx = i % points.size();
        points[idx] = Point<double>(x, y);
        //std::cout << points[idx].getx() << " " << points[idx].getx() << std::endl;
        if(idx == (points.size()-1))
        {
            int a, b;
            distance_argmax<double>(points, a, b);
            auto ans = a!=points.size()-1 && b!=points.size()-1 ? "YES" : "NO";
            std::cout << ans << std::endl;;
        }
        ++i;
    }

    return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

template<typename T>
constexpr T det2(const T &a1, const T &a2, const T &b1, const T &b2) {
  return a1 * b2 - b1 * a2;
}

void solve() {
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    double a = det2(xp - x1, yp - y1, x2 - x1, y2 - y1),
           b = det2(xp - x2, yp - y2, x3 - x2, y3 - y2),
           c = det2(xp - x3, yp - y3, x1 - x3, y1 - y3);
    cout << ((a > 0 && b > 0 && c > 0) || (a < 0 && b < 0 && c < 0) ? "YES" : "NO") << endl;
  }
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.pt", "r", stdin);
	string str = "";

	while (getline (cin, str )){
		if (str.empty() ){
			break;
		} // end if

		vector <double> tpx (3, 0.);
		vector <double> tpy (3, 0.);
		double px = 0.;
		double py = 0.;
		int i;
	
		stringstream ss(str);
		for (i = 0; i < 3; ++i){
			ss >> tpx[i] >> tpy[i];
		} // end for
		ss >> px >> py;
		 
		vector <double> vx(3, 0.);
		vector <double> vy(3, 0.);
		vector <double> vpx(3, 0.);
		vector <double> vpy(3, 0.);

		for (i = 0; i < 3; ++i){
			vx[i] = tpx[(i+1) % 3] - tpx[i];
			vy[i] = tpy[(i+1) % 3] - tpy[i];
		} // end for
		for (i = 0; i < 3; ++i){
			vpx[i] = px - tpx[i];
			vpy[i] = py - tpy[i];
		} // end for
		
		vector <double> D(3, 0.);
		for (i = 0; i < 3; ++i){
			D[i] = (vx[i]*vpy[i] - vy[i]*vpx[i]);
		} // end for

		for (i = 0; i < 3; ++i){
			if (D[i] > 0.0){
				continue;
			}else{
				cout << "NO" << endl;
				break;
			} // end if
		} // end for
		if (i == 3){
			cout << "YES" << endl;
		} // end if 
	
	} // end while
		
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define vP vectorProduct
#define EPS 1e-9

double vectorProduct(double ax,double ay,double bx,double by){return ax*by-ay*bx;}

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){
    if(vP(x2-x1,y2-y1,xp-x1,yp-y1) + EPS > 0 &&
       vP(x3-x2,y3-y2,xp-x2,yp-y2) + EPS > 0 &&
       vP(x1-x3,y1-y3,xp-x3,yp-y3) + EPS > 0)
      printf("YES\n");
    else printf("NO\n");
  }

  return 0;
}

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() {
		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;
			}
			x[0] = x1 - x3;
			y[0] = y1 - y3;
			x[1] = x2 - x3;
			y[1] = y2 - y3;
			x[2] = xp - x3;
			y[2] = yp - y3;
			if(!judge(x, y)) {
				cout << "NO" << endl;
				continue;
			}
			cout << "YES" << endl;
		}
		return 0;
	}