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>

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define repf(i, f, l) for(int i = f; i < (int)l; ++i)

#ifdef ONLINE_JUDGE
#define DEBUG false
#else
#define DEBUG true
#endif

#define pb emplace_back
#define lb lower_bound
#define ul unsigned long
#define ull unsigned long long
#define ll long long
#define INF 1000000007
#define MOD 1000000007
#define fs first
#define sd second

#define ALL(c) (c).begin(),(c).end()

#define DBG0(x)    {if(DEBUG){ cout << #x << ": " << x << "\t"; }}
#define DBG(x)     {if(DEBUG){DBG0(x); cout << endl;}}
#define DBG2(x, y) {if(DEBUG){DBG0(x); DBG(y);}}
#define DBG3(x, y, z) {if(DEBUG){DBG0(x); DBG2(y, z);}}
#define DBG4(w, x, y, z) {if(DEBUG){DBG0(w); DBG3(x, y, z);}}

template <class T>
ostream& operator<<(ostream& os, vector<T> xs){ for(T x: xs) os << x << ' '; return os; }
template <class S, class T>
ostream& operator<<(ostream& os, pair<S,T> st){ os << "(" << st.first << "," << st.second <<")"; return os; }

using namespace std;
const double EPS = 1.0e-14;
typedef complex<double> Point;
istream& operator>>(istream& is, Point &pt){
    double a, b;
    is >> a >> b;
    pt.real(a); pt.imag(b);
    return is;
}

ostream& operator<<(ostream& os, const Point &pt){
    os << make_pair(pt.real(), pt.imag());
    return os;
}

inline double cross(const Point &a, const Point &b){
    return (a.real()*b.imag() - a.imag()*b.real());
}

inline double myarg(Point &a){
    double ret = arg(a);
    return (ret >= 0 ? ret : ret + 2*M_PI);
}

inline double signed_area(const Point &a, const Point &b, const Point &c){
    Point ab = b - a;
    Point ac = c - a;
    return cross(ab, ac) / 2.0;
}

inline bool intersect(const Point &a1, const Point &a2, const Point &b1, const Point &b2) {
  return ((cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS) &&
          (cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS));
}

void sort_by_arg(vector<Point> &pts){
    sort(pts.begin(), pts.end(), [](Point a, Point b){ return (myarg(a) < myarg(b)); });
}

double area(vector<Point> &vs){
    int n = vs.size();
    vector<Point> pts(n - 1);
    rep(i, n - 1) pts[i] = vs[i + 1] - vs[0];
    sort_by_arg(pts);
    double ans = 0.0;
    rep(i, n - 1) ans += cross(vs[i], vs[i + 1]);
    return ans / 2.0;
}


typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ul> vul;
typedef vector<ull> vull;
typedef vector<bool> vbl;
typedef pair<int, int> pii;

bool counter_clock_wise(const Point &a, const Point &b, const Point &c){
    if(cross(a, b) > 0 && cross(b, c) > 0) return true;
    else return false;
}

int main(void){
    Point a, b, c, p;
    while(cin >> a >> b >> c >> p){
        double A, B, C;
        A = cross(b - a, p - a);
        B = cross(c - b, p - b);
        C = cross(a - c, p - c);
        if((A > 0 && B > 0 && C > 0) || 
           (A < 0 && B < 0 && C < 0))
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }
    return 0;
}

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

using namespace std;

#define EPS 1e-10

double heron(double a,double b,double c){
      double s = (a + b + c) / 2;

      return sqrt(s * (s - a) * (s - b) * (s - c));
}

int main() {
    double x[3],y[3],xp,yp,a,b,c,d,e,f,sq,sqd,sqe,sqf;
    
    while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
        a = sqrt(pow((x[1] - x[0]),2) + pow((y[1] - y[0]),2));
        b = sqrt(pow((x[2] - x[0]),2) + pow((y[2] - y[0]),2));
        c = sqrt(pow((x[2] - x[1]),2) + pow((y[2] - y[1]),2));

        sq = heron (a,b,c);

        d = sqrt(pow((xp - x[0]),2) + pow((yp - y[0]),2));
        e = sqrt(pow((xp - x[1]),2) + pow((yp - y[1]),2));
        f = sqrt(pow((xp - x[2]),2) + pow((yp - y[2]),2));

        sqd = heron(e,a,d);
        sqe = heron(d,b,f);
        sqf = heron(f,c,e);
        
        if(sqd == 0 || sqe == 0 || sqf == 0){
             cout << "NO" << endl;
             return 0;
         }
         if(abs(sq - (sqd + sqe + sqf)) < EPS){
            cout << "YES" << endl;
            
        }
        else {
            cout << "NO" << endl;
        }
    }

    return 0;
}

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

bool judge(double s1, double t1, double s2, double t2, double s3, double t3, double xp, double yp);

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

	while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
		if(judge(x1,y1,x2,y2,x3,y3,xp,yp) && judge(x2,y2,x1,y1,x3,y3,xp,yp) && judge(x3,y3,x1,y1,x2,y2,xp,yp)){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}

	return(0);
}


bool judge(double s1, double t1, double s2, double t2, double s3, double t3, double xp, double yp){
	double a, b1, b2, b3;

	if(s2-s3 == 0.0){
		if(min(s1,s2) < xp && xp < max(s1,s2)){
			return true;
		}else{
			return false;
		}
	}else{
		a = (t2-t3)/(s2-s3);
		b1 = t2 - a*s2;
		b2 = t1 - a*s1;
		b3 = yp - a*xp;
	}

	if(min(b1,b2) < b3 && b3 < max(b1,b2)){
		return true;
	}else{
		return false;
	}
}

C++: #include <iostream>
#include <math.h>
using namespace std;

class point{ // as necessary
	private:
		static const double EPS=1e-5;
	public:
		static const int COUNTER_CLOCKWISE=1;
		static const int CLOCKWISE=-1;
		static const int ONLINE_BACK=2;
		static const int ONLINE_FRONT=-2;
		static const int ON_SEGMENT=0;

		double x;
		double y;
		point(double x=0,double y=0):x(x),y(y){}

		point operator+(point p){return point(x+p.x,y+p.y);}
		point operator-(point p){return point(x-p.x,y-p.y);}
		point operator*(const double a){return point(x*a,y*a);}
		point operator/(const double a){return point(x/a,y/a);}

		static double dot(const point &p1,const point &p2){
			return p1.x*p2.x+p1.y*p2.y;
		}

		double norm(){
			return x*x+y*y;
		}

		double abs(){
			return sqrt(norm());
		}

		static double cross(point p1,point p2){
			return p1.x*p2.y-p1.y*p2.x;
		}

		static int ccw(point p0,point p1,point p2){
			point a=p1-p0; // ??????p0p1
			point b=p2-p0; // ??????p0p2
			if(cross(a,b)>EPS) return COUNTER_CLOCKWISE; // a????????????b??????????¨?
			if(cross(a,b)<-EPS) return CLOCKWISE; // a????????????b???????¨?
			if(dot(a,b)<-EPS) return ONLINE_BACK; // p2-p0-p1???????????¢???
			if(a.norm(),b.norm()) return ONLINE_FRONT; // p0-p1-p2???????????¢???
			return ON_SEGMENT; // p0-p2-p1???????????¢???
		}
};

int main(void){
	double x,y;
	while(cin>>x>>y){
		int rcw=0;
		int cw=0;
		point a(x,y);
		cin>>x>>y;
		point b(x,y);
		cin>>x>>y;
		point c(x,y);
		cin>>x>>y;
		point d(x,y);
		switch(point::ccw(a,b,d)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		switch(point::ccw(b,c,d)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		switch(point::ccw(c,a,d)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		if(rcw==1&&cw==2)cout<<"NO"<<endl;
		else cout<<"YES"<<endl;
	}
}