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++: // 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

bool existIntersection(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
  return ((x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)) *
           ((x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)) <
         0;
}

void solve() {
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    if ((x1 - x3) * (y1 - y2) == (x1 - x2) * (y1 - y3)) {
      cout << "NO" << endl;
      break;
    }
    double gx = (x1 + x2 + x3) / 3;
    double gy = (y1 + y2 + y3) / 3;
    if (existIntersection(x1, y1, x2, y2, xp, yp, gx, gy)) {
      cout << "NO" << endl;
      break;
    }
    if (existIntersection(x2, y2, x3, y3, xp, yp, gx, gy)) {
      cout << "NO" << endl;
      break;
    }
    if (existIntersection(x3, y3, x1, y1, xp, yp, gx, gy)) {
      cout << "NO" << endl;
      break;
    }
    cout << "YES" << endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <sstream>
#include <cstdio>
using namespace std;

// A Point in a Triangle(0012)
double area(const double x1, const double y1, const double x2, const double y2, const double x3, const double y3)
{
	double s = x1*y2 - x1*y3 + x2*y3 - x2*y1 + x3*y1 - x3*y2;
	if (s < 0)
		s = -s;
	return s / 2.0;
}

int main()
{
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		double St = area(x1, y1, x2, y2, x3, y3);

		double S1 = area(x1, y1, x2, y2, xp, yp);
		double S2 = area(x2, y2, x3, y3, xp, yp);
		double S3 = area(x3, y3, x1, y1, xp, yp);

		if (S1 != 0 && S2 != 0 && S3 != 0 && S1+S2+S3 == St)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

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

// テァツつケテ・ツコツァテヲツィツ凖」ツつ津・ツ楪凝」ツ?ィテ」ツ?凖」ツつ?
typedef complex<double> P;
// テ渉?」ツ?ョテ・ツョツ堙ァツセツゥ
#define PI 3.1415926535898

// ティツィツアテ・ツョツケテ」ツ?凖」ツつ凝ィツェツ、テ・ツキツョテ篠オ
#define EPS (1e-10)
//XYテ・ツコツァテヲツィツ?
#define X real()
#define Y imag()

//テッツシツ津」ツ?、テ」ツ?ョdoubleテ・ツ楪凝」ツ?ョテヲツ閉ーテ・ツ?、テ」ツ?古ァツュツ嘉」ツ?療」ツ??」ツ?凝」ツ?ゥテ」ツ??」ツ??
bool equal(double a, double b){
	return ( abs( a-b ) < EPS )? true : false ;
}
	
// テ、ツクツ嘉ィツァツ津・ツスツ「テ」ツつッテ」ツδゥテ」ツつケ
class Triangle{

private:
	//テ、ツクツ嘉ィツァツ津・ツスツ「テ」ツ?ョテッツシツ禿ァツつケテ」ツ?ョテ・ツコツァテヲツィツ?
	P a, b, c;
	//テ、ツクツ嘉ィツァツ津・ツスツ「テ」ツ?ョテッツシツ禿ィツセツコテ」ツ?ョテゥツ閉キテ」ツ??
	double edgeA,edgeB,edgeC;
	//テ、ツクツ嘉ィツァツ津・ツスツ「テ」ツ?ョテッツシツ禿ィツァツ津」ツ?ョテ・ツ、ツァテ」ツ?催」ツ??テ」ツδゥテ」ツつクテ」ツつ「テ」ツδウ)
	double angleA,angleB,angleC;
	//テ、ツスツ凖・ツシツヲテ・ツョツ堙ァツ青?」ツ?凝」ツつ嘉ッツシツ禿」ツ?、テ」ツ?ョティツァツ津・ツコツヲテ」ツつ津ヲツアツづ」ツつ?」ツつ凝ゥツ鳴「テヲツ閉ー
	double LawOfCosines(double a,double b, double c){
		return acos( (b*b+c*c-a*a) / (2.0*b*c) );
	}
	
public:
	//テ」ツつウテ」ツδウテ」ツつケテ」ツδ暗」ツδゥテ」ツつッテ」ツつソ(テッツシツ禿」ツ?、テ」ツ?ョテァツつケテ」ツ?ィティツセツコテ」ツ?ィティツァツ津・ツコツヲテ」ツつ津・ツ按敕ヲツ慊淌・ツ個?
	Triangle(P p1, P p2, P p3){
		a = p1;
		b = p2;
		c = p3;
		edgeB = abs(c-a);
		edgeA = abs(b-c);
		edgeC = abs(a-b);
		angleA = LawOfCosines(edgeA,edgeB,edgeC);
		angleB = LawOfCosines(edgeB,edgeC,edgeA);
		angleC = LawOfCosines(edgeC,edgeA,edgeB);
	}
	double getAngleC(){//ティツァツ辰テ」ツ?ョティツァツ津・ツコツヲテ」ツつ津・ツ、ツ嘉」ツ?暗」ツ??
		return angleC;
	}
};

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

	while( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp ){
		P a( x1 , y1 );
		P b( x2 , y2 );
		P c( x3 , y3 );
		P p( xp , yp );
		Triangle Tr1(a,b,p);
		Triangle Tr2(b,c,p);
		Triangle Tr3(c,a,p);
		angle = Tr1.getAngleC() + Tr2.getAngleC() + Tr3.getAngleC();
		( equal( 2.0*PI , angle) )? cout << "YES" : cout << "NO" ;
		cout << endl;
	}
}

C++: #include <iostream>
#include <cmath>
#define EPS (1.0e-8)

using namespace std;
 
int main() {
  double x1, y1, x2, y2, x3, y3, xp, yp;
  double a[2], b[2];
  double A, B;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    a[0] = x2 - x1;
    a[1] = y2- y1;
    b[0] = x3 - x1;
    b[1] = y3 - y1;
    if(fabs(a[0] * b[0] + a[1] * b[1]) != 1) {
      A = (b[1] * (xp - x1) - b[0] * (yp - y1)) / (a[0] * b[1] - b[0] * a[1]);
      B = (a[1] * (xp - x1) - (yp - y1) * a[0]) / (a[1] * b[0] - b[1] * a[0]);
      if ((A+B < 1) && (A > 0) && (B > 0)) {
        cout << "YES" << endl;
      }
      else {
        cout << "NO" << endl;
      }
    }
    else
      cout << "NO" << endl;
  }
}