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;

bool is_up (double x1, double y1, double x2, double y2, double px, double py) {
    if (x1 == x2) return px > x1;
    return (py > (y2 - y1) / (x2 - x1) * px + (x1 * y2 - x2 * y1) / (x1 - x2) );
}

int main() {
    double x1,y1,x2,y2,x3,y3,xp,yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        int up = 0;
        up += is_up(x1, y1, x2, y2, xp, yp);
        up += is_up(x3, y3, x2, y2, xp, yp);
        up += is_up(x1, y1, x3, y3, xp, yp);

        if (up == 1) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}

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

struct Vector{
	double x;
	double y;
};

Vector sub_vector(Vector &a , Vector &b){
	Vector ret;
	ret.x=a.x-b.x;
	ret.y=a.y-b.y;
	return ret;
}

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	Vector v[4];
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		v[0].x=x1; //a
		v[0].y=y1;
		v[1].x=x2; //b
		v[1].y=y2;
		v[2].x=x3; //c
		v[2].y=y3;
		v[3].x=xp; //p
		v[3].y=yp;
		Vector ba = sub_vector(v[0] , v[1]);
		Vector bp = sub_vector(v[3] , v[1]);
		Vector cb = sub_vector(v[1] , v[2]);
		Vector cp = sub_vector(v[3] , v[2]);
		Vector ac = sub_vector(v[2] , v[0]);
		Vector ap = sub_vector(v[3] , v[0]);
		double c1 = ba.x * bp.y - ba.y * bp.x; //??????
		double c2 = cb.x * cp.y - cb.y * cp.x;
		double c3 = ac.x * ap.y - ac.y * ap.x;
		if((c1<0 && c2<0 && c3 <0)||(c1>=0 && c2>=0 && c3>=0)) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
		
	}
	return 0;
}

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

int main(void){

	double x1,x2,x3,xp,y1,y2,y3,yp,l12,l23,l13,l1p,l2p,l3p,S123,S12p,S23p,S13p;

	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){

		l12=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		l23=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
		l13=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
		l1p=sqrt((x1-xp)*(x1-xp)+(y1-yp)*(y1-yp));
		l2p=sqrt((x2-xp)*(x2-xp)+(y2-yp)*(y2-yp));
		l3p=sqrt((x3-xp)*(x3-xp)+(y3-yp)*(y3-yp));
		S123=(sqrt((l12+l23+l13)*(-l12+l23+l13)*(l12-l23+l13)*(l12+l23-l13)))/4;
		S12p=(sqrt((l12+l2p+l1p)*(-l12+l2p+l1p)*(l12-l2p+l1p)*(l12+l2p-l1p)))/4;
		S13p=(sqrt((l1p+l3p+l13)*(-l1p+l3p+l13)*(l1p-l3p+l13)*(l1p+l3p-l13)))/4;
		S23p=(sqrt((l2p+l23+l3p)*(-l2p+l23+l3p)*(l2p-l23+l3p)*(l2p+l23-l3p)))/4;
		if(fabs(S123-(S12p+S13p+S23p))<0.1){
			puts("YES");
		}
		else{
			puts("NO");
		}
	}

	return 0;
}

C++: #include<iostream>

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while (std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		double ax, ay, bx, by, s, t;
		ax = x2 - x1; ay = y2 - y1;
		bx = x3 - x1; by = y3 - y1;
		// sa + tb = p - ra
		// sax + tbx = xp - x1
		// say + tby = yp - y1
		s = (yp - y1 - ((xp - x1) / bx)) / (ay - (ax / bx));
		t = (xp - x1 - (s * ax)) / bx;
		if (s > 0 && t > 0 && s + t < 1) std::cout << "YES" << std::endl;
		else std::cout << "NO" << std::endl;
	}
	return 0;
}

C++: 
#include <iostream>
#include <vector>
#include <cmath>
#include <cassert>
#include <complex>
#include <algorithm>
#define rep(i,n) for(int i = 0;i < n;i++)
using namespace std;

typedef complex<double> P;
const double EPS = 1e-8;
const double INF = 1e6;

double cross(P a,P b){
    return imag(conj(a)*b);
}


int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    while(cin >>x1>> y1>> x2>> y2>> x3>> y3>> xp>> yp){
        P v1=P(x1,y1),v2=P(x2,y2),v3=P(x3,y3),vp=P(xp,yp);
        if((cross(vp-v1,vp-v2)>0)&&(cross(vp-v2,vp-v3)>0)&&(cross(vp-v3,vp-v1)>0)){
            cout << "YES"<<endl;
        }else if((cross(vp-v1,vp-v2)<0)&&(cross(vp-v2,vp-v3)<0)&&(cross(vp-v3,vp-v1)<0)){
            cout << "YES"<<endl;
        }else{
            cout << "NO"<<endl;
        }

    }
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
struct axis
{
    double x,y;

};
double area(axis a,axis b,axis c)
{
    double are=(a.x* (b.y-c.y)-a.y*(b.x-c.x)+(b.x * c.y- c.x * b.y))/2;
    return abs(are);
}
int main()
{
    axis a,b,c,x;
    while(cin>>a.x>>a.y>>b.x>>b.y>>c.x>>c.y>>x.x>>x.y)
    {

        double areatot=area(a,b,c),areaa=area(a,b,x),areab=area(b,c,x),areac=area(c,a,x);
        if(areatot==(areaa+areab+areac))
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;


    }


    return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <complex>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<double> VEC;
typedef vector<VEC> MAT;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))
#define T1 first
#define T2 second.first
#define T3 second.second.first
#define T4 second.second.second

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define EPS 1.0e-9

int main(){
	double x1, x2, x3, y1, y2, y3, xp, yp;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		double a = x2-x1;
		double b = x3-x1;
		double c = xp-x1;
		double d = y2-y1;
		double e = y3-y1;
		double f = yp-y1;
		double s = (c*e-b*f)/(a*e-b*d);
		double t = (a*f-c*d)/(a*e-b*d);
		if(s+t<1 && s>0 && t>0)cout << "YES" << endl;
		else cout <<"NO" <<endl;
	}
	return 0;
}