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 <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i ++)
using namespace std;
using ll = long long;
using PL = pair<ll,ll>;
using P = pair<int,int>;
constexpr int INF = 1000000000;
constexpr long long HINF = 1000000000000000;
constexpr long long MOD = 1000000007;
constexpr double EPS = 1e-10;
constexpr double PI = 3.14159265358979;

/*
Parallelism
ベクトルAB　と　ベクトルCD が垂直　<=> cross(AB,CD) = 0
を利用してとく。epsは適当に調整する。
*/

/* geometry libarary */

// a > 0 : +1, a == 0 : 0, a < 0 : -1
int sgn(const double a) {return (a < - EPS ? -1: (a > EPS ? 1: 0));}

/* 2d Point class */
struct Point {
    double x,y;
    constexpr Point(double x = 0.0,double y = 0.0) :x(x),y(y) {}

    Point operator+() const {return *this;}
    Point operator-() const {return Point(-x,-y);}

    constexpr Point &operator+=(const Point &q) {x += q.x;y += q.y;return *this;}
    constexpr Point &operator-=(const Point &q) {x -= q.x;y -= q.y;return *this;}
    constexpr Point &operator*=(double a) {x *= a;y *= a;return *this;}
    constexpr Point &operator/=(double a) {x /= a;y /= a;return *this;}
    
    constexpr Point operator+(const Point &q) const {return Point(*this) += q;}
    constexpr Point operator-(const Point &q) const {return Point(*this) -= q;}
    constexpr Point operator*(double a) const  {return Point(*this) *= a;}
    constexpr Point operator/(double a) const {return Point(*this) /= a;}

    inline bool operator<(const Point&q) const {return (sgn(x - q.x) != 0 ? sgn(x - q.x) < 0 : sgn(y - q.y) < 0);}
    inline bool operator>(const Point&q) const {return (sgn(x - q.x) != 0 ? sgn(x - q.x) > 0 : sgn(y - q.y) > 0);}
    inline bool operator==(const Point&q) const {return (sgn(x - q.x) == 0 && sgn(y - q.y) == 0);}

    friend ostream& operator<<(ostream& os,const Point &p) {return os << '(' << p.x << ", " << p.y << ')';}
    friend istream& operator>>(istream& is,Point &p) {return is >> p.x >> p.y;}
};

constexpr double dot(const Point &p,const Point &q) {return p.x * q.x + p.y * q.y;}
constexpr double cross(const Point &p,const Point &q) {return p.x * q.y - q.x * p.y;}
constexpr double norm(const Point &p) {return dot(p,p);}
inline double length(const Point &p) {return sqrt(norm(p));}
inline double dist(const Point &p,const Point &q) {return length(p - q);}
constexpr double sgn_area(const Point &p,const Point &q,const Point &r) {return cross(q - p,r - p)/2.0;}
constexpr double area(const Point &p,const Point &q,const Point &r) {return abs(sgn_area(p,q,r));}
inline Point normalized(const Point &p) {Point x = p/length(p);return x;}
inline Point rotation(const Point &p,double arg) {return Point(cos(arg) * p.x - sin(arg) * p.y,sin(arg) * p.x + cos(arg) * p.y);}
inline double angle(const Point &p) {return atan2(p.y,p.x);}

/*ab bc __/: +1
  ab bc --\: -1
  abc   ---: +2
  acb   ---: -2
  bac   ---:  0  */
int iSP(const Point &a,const Point &b,const Point &c) { 
    if (sgn(cross(b - a,c - a)) > 0) return 1;
    if (sgn(cross(b - a,c - a)) < 0) return -1;
    if (sgn(dot(b - a,c - b)) > 0) return 2;
    if (sgn(dot(a - b,c - a)) > 0) return -2;
    return 0;
}
//error point: changed depending on the problem
const Point error_point(INF,INF);

/* 2d Line(or Segment or Ray) class */
//2d Line class
struct Line {
    Point P,Q;
    constexpr Line(const Point &P,const Point &Q):P(P),Q(Q) {}
    constexpr Point vec() const {return Q - P;}
};
using Segment = Line;
using Ray = Line;

Point lineIntersection(const Line &l1,const Line &l2) {
    if (sgn(cross(l1.vec(),l2.vec())) == 0) return error_point;
    return l1.P + l1.vec() * abs(cross(l2.Q - l1.P,l2.vec())/cross(l1.vec(),l2.vec()));
}
/*
Point segmenIntersection(const Segment &s1,const Segment &s2) {
}
*/
double distance(const Point &p,const Line &l) {
    return abs(cross(l.vec(),p - l.P)/length(l.vec()));
}

int main() {
    vector<Point> P(3);
    Point p;
    while (1) {
        double x,y;
        if (scanf("%lf",&x) == EOF) break;
        cin >> y; P[0] = Point(x,y);
        cin >> P[1] >> P[2] >> p;
        if (sgn_area(p,P[0],P[1]) > 0 && sgn_area(p,P[1],P[2]) > 0 && sgn_area(p,P[2],P[0]) > 0) {
            cout << "YES" << '\n';
        } else if (sgn_area(p,P[0],P[1]) < 0 && sgn_area(p,P[1],P[2]) < 0 && sgn_area(p,P[2],P[0]) < 0){
            cout << "YES" << '\n';
        } else {
            cout << "NO" << '\n';
        }
    }
    return 0;
}

C++: #include<cstdio>
#include<cmath>
 
//#include<iostream>
using namespace std;
 
int main(){
    float  x1, y1, x2, y2, x3, y3, xp, yp;
	float  xa, ya, xb, yb, xc, yc, k;

	while( ~scanf("%f%f%f%f%f%f%f%f" , &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)){
		xa=x2-x1; ya=y2-y1;
		xb=x3-x1; yb=y3-y1;
		xc=xp-x1; yc=yp-y1;

		if(xa-xb) 	k=(xc-xb)/(xa-xb);
		else		k=(yc-yb)/(ya-yb);	

		if (0<k && k<1) printf("YES\n");
		else		printf("NO\n");
	}

    return 0;
}