Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <iostream>

using namespace std;

int islineCross(double x1, double y1, double x2, double y2, double c1, double c2, double d1, double d2) {
  if (((c2-y1)*(x1-x2)-(c1-x1)*(y1-y2))*((d2-y1)*(x1-x2)-(d1-x1)*(y1-y2)) > 0)
    return -1;
  else
    return 0;
}

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

  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    int CrossCount = 0;
    if (islineCross(x1,y1,x2,y2,xp,yp,xp+100,yp) == 0)
      CrossCount++;
    if (islineCross(x2,y2,x3,y3,xp,yp,xp+100,yp) == 0)
      CrossCount++;
    if (islineCross(x1,y1,x3,y3,xp,yp,xp+100,yp) == 0)
      CrossCount++;
    
    if (CrossCount == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } 

  return 0;
}

C++: #include<iostream>
#include<math.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

double dist(double x1, double y1, double x2, double y2){
    return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}

double triangleArea(double x, double y, double z){
    return (y * z * sin( acos( (y * y +  z * z - x * x) / (2 * y * z) ) )) / 2;
}

double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
    double x, y ,z;
    x = dist(x1, y1, x2, y2);
    y = dist(x2, y2, x3, y3);
    z = dist(x3, y3, x1, y1);
    return triangleArea(x, y, z);
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    double allArea, area12, area23, area31;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
    allArea = inputXY(x1, y1, x2, y2, x3, y3);
    area12 = inputXY(xp, yp, x2, y2, x1, y1);
    area23 = inputXY(x2, y2, x3, y3, xp, yp);
    area31 = inputXY(x3, y3, x1, y1, xp, yp);

    if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
    else cout << "NO" << endl;

}

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

using namespace std;

int main(){
    double a, b, c, d, e, f;
    double p, q;
    while(cin >> a >> b >> c >> d >> e >> f){
        cin >> p >> q;
        vector<int> x(3), y(3);
        x[0] = a; x[1] = c; x[2] = e;
        y[0] = b; y[1] = d; y[2] = f;
        int ret = 0;
        bool is = false;
        for(int i=0; i < x.size(); i++){
            double X1 = x[i%3], X2 = x[(i+1)%3], X3 = x[(i+2)%3];
            double Y1 = y[i%3], Y2 = y[(i+1)%3], Y3 = y[(i+2)%3];
            int ans = 0;
            if ((X2-X1)*(q-Y1)-(Y2-Y1)*(p-X1)>0.0) ans++;
            if ((X3-X2)*(q-Y2)-(Y3-Y2)*(p-X2)>0.0) ans++;
            if ((X1-X3)*(q-Y3)-(Y1-Y3)*(p-X3)>0.0) ans++;
            if(ans%3==0) is = true;
        }
        cout << (is?"YES":"NO") << endl;
    }
}

C++: #include <iostream>
double x[3], y[3], xp, yp;
int main() {
	while (std::cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>xp>>yp) {
		int bit = 3;
		for (int i=0; i<3; ++i) {
			double tmp = (x[(i+1)%3]-x[i])*(yp-y[i])-(y[(i+1)%3]-y[i])*(xp-x[i]);
			bit &= ~((tmp < 0) + 1);
		}
		std::cout << (bit ? "YES" : "NO") << "\n";
	}
}

C++: #include<bits\stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

double dist(double x1, double y1, double x2, double y2){
    return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}

double triangleArea(double x, double y, double z){
    return (y * z * sin( acos( (y * y +  z * z - x * x) / (2 * y * z) ) )) / 2;
}

double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
    double x, y ,z;
    x = dist(x1, y1, x2, y2);
    y = dist(x2, y2, x3, y3);
    z = dist(x3, y3, x1, y1);
    return triangleArea(x, y, z);
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    double allArea, area12, area23, area31;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
    allArea = inputXY(x1, y1, x2, y2, x3, y3);
    area12 = inputXY(xp, yp, x2, y2, x1, y1);
    area23 = inputXY(x2, y2, x3, y3, xp, yp);
    area31 = inputXY(x3, y3, x1, y1, xp, yp);

    if(abs(allArea - (area12 + area23 + area31)) < 0.00001) 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()
#define EQ(a,b) (abs((a)-(b)) < EPS)
typedef complex<double> P;
const double EPS = 1e-10;

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

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

int is_point_on_line(P a, P b, P c) {
	if ( EQ(abs(a-c), 0.0) || EQ(abs(b-c), 0.0) ) return 1;

	if (a.real() < b.real()) {
		if (c.real() < a.real() || b.real() < c.real()) return 0;
	} else {
		if (c.real() < b.real() || a.real() < c.real()) return 0;
	}

	if (a.imag() < b.imag()) {
		if (c.imag() < a.imag() || b.imag() < c.imag()) return 0;
	} else {
		if (c.imag() < b.imag() || a.imag() < c.imag()) return 0;
	}

	return EQ( cross(b-a, c-a), 0.0 );
}

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]);

		bool f = false;
		rep(i, 3) {
			if (is_point_on_line(a[i], a[(i + 1) % 3], r)) {
				cout << "NO" << endl;
				f = true;
			}
		}

		if (f) continue;
		int ans = 1;
		int cnt = 0;
		rep(_, 4) {
			rep(i, 3) {
				cnt += is_intersected(a[i], a[(i + 1) % 3], r, P(100.1 * (_ & 2 ? 1 : -1), 100.1 * (_ & 1 ? 1 : -1)));
			}
			ans *= cnt;
		}

		cout << (ans ? "YES" : "NO") << endl;
	}
}