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

    double x1, y1, x2, y2, x3, y3, xp, yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        pair<double, double> a, b, p;
        a.first = x2 - x1;
        a.second = y2 - y1;
        b.first = x3 - x1;
        b.second = y3 - y1;
        p.first = xp - x1;
        p.second = yp - y1;
        double theta = angle(a, b);
        double phi = angle(a, p);
        double psi = angle(b, p);
        
        if (norm(p) > norm(a) || norm(p) > norm(b)) {
            anslist.push_back("NO");
            break;
        }
        if (phi > theta || psi > theta) {
            anslist.push_back("NO");
            break;
        }
        anslist.push_back("YES");
    }

    for(auto ans : anslist) {
        cout << ans << endl;
    }

    return 0;
}

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

int main(){
    double x[4],y[4];
    while(cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>x[3]>>y[3]){
        double a[3],b[3],c[3],d[3];
        for(int i=0;i<3;i++){
            a[i]=x[(i+1)%3]-x[i];
            b[i]=y[(i+1)%3]-y[i];
        }
        for(int i=0;i<3;i++){
            c[i]=x[3]-x[i];
            d[i]=y[3]-y[i];
        }
        int suc=1;
        for(int i=0;i<3;i++){
            
            if((a[i]*b[(i+1)%3]-a[(i+1)%3]*b[i])*(a[i]*d[(i+1)%3]-c[(i+1)%3]*b[i])<0){
                suc=0;
                break;
            }
        }
        if(suc==0)
            cout<<"NO"<<endl;
        else
            cout<<"YES"<<endl;
    }
}

C++: //二次元幾何ライブラリ
#include <iostream>
#include <complex>
#include <map>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define X real()
#define Y imag()
typedef long double D;
typedef bool B;
typedef complex<D> P;   //点
typedef complex<D> V;   //ベクトル
typedef pair<P,P>  L;   //直線
typedef pair<P,D>  C;   //円
typedef vector<P>  Pol; //多角形

//変数名定義
const D INF = 1e100;
const D EPS = 1e-8;
const D PI = acos(-1);

template<class T> bool operator==(T a, T b){return abs(a - b )< EPS;}
template<class T> int sig(T r) {return (r==0||r==-0) ? 0 : r > 0 ? 1 : -1;}

  bool operator < (const P& a, const P& b) {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }

// ベクトルaの絶対値を求める
// D Length = abs(a);

// 2点a,b間の距離を求める
// D Distance = abs(a-b); 

// 内積 (Inner Product) : a・b = |a||b|cosθ
D IP(V a, V b) {
	return (a.real() * b.real() + a.imag() * b.imag());
}

// 外積 (Exterior Product) : a×b = |a||b|sinθ
D EP(V a, V b) {
	return (a.real() * b.imag() - a.imag() * b.real());
}

// 点の進行方向について 3
int ccw(P a, P b, P c) {              //点aと点bが与えられた問いに
  b -= a; c -= a;
  if (EP(b, c) > 0)   return +1;      // counter clockwise
  if (EP(b, c) < 0)   return -1;      // clockwise
  if (IP(b, c) < 0)     return +2;    // c--a--b on line
  if (norm(b) < norm(c)) return -2;   // a--b--c on line
  return 0;                           // a--c--b on line  aとbの線分判定はこれ
}

int main(void){
	while(true){
		if(cin.eof())
			break;
		P point[4];	
		rep(j,4)
		cin >> point[j].X >> point[j].Y;
		int tmp=ccw(point[0],point[1],point[3]);
		bool flag=true;
		for(int i=1;i<3;i++)
			if(tmp !=ccw(point[i%3],point[(i+1)%3],point[3]))
				flag=false;
		if(flag)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

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

double pdot(pair<double,double> a,pair<double,double> b){
	return a.first*b.first + a.second*b.second;
}

int main(){
	double a1,a2,b1,b2,c1,c2,p1,p2;
	while(cin>>a1>>a2>>b1>>b2>>c1>>c2>>p1>>p2){
	pair<double,double> v0 = make_pair(c1-a1,c2-a2);
	pair<double,double> v1 = make_pair(b1-a1,b2-a2);
       	pair<double,double> v2 = make_pair(p1-a1,p2-a2);
	double dot00 = pdot(v0,v0), dot01 = pdot(v0,v1), dot02 = pdot(v0,v2), dot11 = pdot(v1,v1);
	double dot12 = pdot(v1,v2);
	double id = 1.0 / (dot00 * dot11 - dot01 * dot01);
	double u = (dot11 * dot02 - dot01 * dot12) * id;
	double v = (dot00 * dot12 - dot01 * dot02) * id;
	//cout<<u<<":"<<v<<endl;
	if(u>=0 && v>=0 && u+v<1)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
typedef struct{
	double x;
	double y;
}Point;
double get_area(Point p1,Point p2,Point p3)
{
	double area;
	area = (p1.x*p2.y+p2.x*p3.y+p3.x*p1.y-p2.x*p1.y-p3.x*p2.y-p1.x*p3.y)/2;
	if(area<0)
	{
		area = -area;
	}
	return area;
}
int main()
{
	Point pp[3];
	Point t;
	double area,area1,area2,area3;
	while(cin>>pp[0].x)
	{
		cin>>pp[0].y>>pp[1].x>>pp[1].y>>pp[2].x>>pp[2].y>>t.x>>t.y;
		area = get_area(pp[0],pp[1],pp[2]);
		area1 = get_area(pp[0],pp[1],t);
		area2 = get_area(pp[0],pp[2],t);
		area3 = get_area(pp[1],pp[2],t);
		if(area==(area1+area2+area3))
		{
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}