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>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

double cross(double x1,double y1,double x2,double y2)
{
	return x1*y2-x2*y1;
}

bool ccw(double x1,double y1,double x2,double y2,double x3,double y3)
{
	return cross(x2-x1,y2-y1,x3-x1,y3-y1)>0;
}

int main()
{
	for(string s;getline(cin,s);){
		istringstream iss(s);
		vector<double> x(3),y(3);
		rep(i,3)
			iss>>x[i]>>y[i];
		double xp,yp;
		iss>>xp>>yp;
		
		if(!ccw(x[0],y[0],x[1],y[1],x[2],y[2])){
			swap(x[1],x[2]);
			swap(y[1],y[2]);
		}
		
		bool in_triangle=true;
		rep(i,3){
			if(!ccw(x[0],y[0],x[1],y[1],xp,yp))
				in_triangle=false;
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}
		
		cout<<(in_triangle?"YES":"NO")<<endl;
	}
	
	return 0;
}

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

struct Point {
  double X, Y;
  Point(double x, double y) :X(x), Y(y) {}
};

double cross(Point p0, Point p1, Point p2) {
  Point a = Point(p1.X - p0.X, p1.Y - p0.Y);
  Point b = Point(p2.X - p0.X, p2.Y - p0.Y);
  return a.X * b.Y - a.Y * b.X;
}

bool is_contain(Point a, Point b, Point c, Point p) {
  double c1 = cross(a, b, p);
  double c2 = cross(b, c, p);
  double c3 = cross(c, a, p);
  if (c1 > 0 && c2 > 0 && c3 > 0) return true;
  if (c1 < 0 && c2 < 0 && c3 < 0) return true;
  return false;
}

int main() {
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while (~scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)) {
    Point a = Point(x1, y1);
    Point b = Point(x2, y2);
    Point c = Point(x3, y3);
    Point p = Point(xp, yp);
    if (is_contain(a, b, c, p)) puts("YES");
    else puts("NO");
  }
}

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

using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)

bool judge(double x[3], double y[3]) {
	double rad1 = atan2(y[0], x[0]);
	cout << rad1 << endl;
	double rad2 = atan2(y[1], x[1]);
	cout << rad2 << endl;
	double rad3 = atan2(y[2], x[2]);
	cout << rad3 << endl;
	if(rad3 < rad1 && rad2 < rad3 || rad1 < rad3 && rad3 < rad2) return true;
	else return false;
}

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
		double x[3], y[3];
		x[0] = x2 - x1;
		y[0] = y2 - y1; 
		x[1] = x3 - x1;
		y[1] = y3 - y1;
		x[2] = xp - x1;
		y[2] = yp - y1;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			break;
		}
		x[0] = x1 - x2;
		y[0] = y1 - y2;
		x[1] = x3 - x2;
		y[1] = y3 - y2;
		x[2] = xp - x2;
		y[2] = yp - y2;
		if(!judge(x, y)) {
			cout << "NO" << endl;
			break;
		}
		cout << "YES" << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	double v0[2], v1[2], v2[2], p[2];	//[0]にx座標、[1]にy座標

	while (cin >> v0[0] >> v0[1] >> v1[0] >> v1[1] >> v2[0] >> v2[1] >> p[0] >> p[1])
	{
		double v0v1[2] = {v1[0]-v0[0], v1[1]-v0[1]},
			   v1v2[2] = {v2[0]-v1[0], v2[1]-v1[1]},
			   v2v0[2] = {v0[0]-v2[0], v0[1]-v2[1]},
			   v0p[2]  = {p[0]-v0[0],  p[1]-v0[1]},
			   v1p[2]  = {p[0]-v1[0],  p[1]-v1[1]},
			   v2p[2]  = {p[0]-v2[0],  p[1]-v2[1]},

			   vv0 = v0v1[0]*v0p[1] - v0v1[1]*v0p[0],
			   vv1 = v1v2[0]*v1p[1] - v1v2[1]*v1p[0],
			   vv2 = v2v0[0]*v2p[1] - v2v0[1]*v2p[0];

		if((vv0>0 && vv1>0 && vv2>0) || (vv0<0 && vv1<0 && vv2<0)) {
			cout << "YES" << endl;
		}else{
			cout << "NO"  << endl;
		}
	}

	return 0;
}

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

using namespace std;

struct Point {
    double x, y;
};

double len(Point p1, Point p2) {
    return sqrt((p1.x - p2.x)*(p1.x - p2.x) + (p1.y - p2.y)*(p1.y - p2.y));
}

double area(Point *points) {
    double a = len(points[0], points[1]);
    double b = len(points[1], points[2]);
    double c = len(points[2], points[0]);
    double s = (a + b + c) / 2;
    return sqrt(s*(s - a)*(s - b)*(s - c));
}

int is_in(Point *points, Point search) {
    double src = area(points);
    double a, b, c;
    
    swap(points[0], search);
    a = area(points);
    swap(points[0], search);

    swap(points[1], search);
    b = area(points);
    swap(points[1], search);

    swap(points[2], search);
    c = area(points);
    swap(points[2], search);

    if (src - 1e-5 < a + b + c && a + b + c < src + 1e-5) {
        return 1;
    }
    else {
        return 0;
    }
}

int main() {
    while (1) {
        Point points[3];
        Point search;

        for (int i = 0; i < 3; i++) {
            if (!(cin >> points[i].x >> points[i].y)) {
                return 0;
            }
        }
        cin >> search.x >> search.y;
    
        if (is_in(points, search) == 1) {
            cout << "YES\n";
        }
        else {
            cout << "NO\n";
        }
    }
    
    return 0;
}

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

struct Pos{
	double x,y;
};

Pos VSub(Pos pos1,Pos pos2){
	pos1.x -= pos2.x;
	pos1.y -= pos2.y;
	return pos1;
}

Pos Rotate(Pos v,double ang){
	double t;
	t = v.y;
	v.y = v.y*cos(ang)+v.x*sin(ang);
	v.x = v.x*cos(ang)-t*sin(ang);
	return v;
}
int main(){
	Pos point[4];	//point[3]:ten
	char *c[200];
	int i,cor = 0;
	while(cin >> point[0].x){
		cin >> point[0].y;
		for(i = 1;i < 4;i++){
			cin >> point[i].x >> point[i].y;
		}
		Pos v[6];
		double at[6];
		for(i = 0;i < 3;i++){
			v[i] = VSub(point[(i+1)%3],point[i]);
			v[i+3] = VSub(point[3],point[i]);
		}
		for(i = 0;i < 3;i++){
			at[i] = atan2(v[i].y,v[i].x);
			v[i+3] = Rotate(v[i+3],-at[i]);
			at[i+3] = atan2(v[i+3].y,v[i+3].x);
		}
		if(at[3] * at[4] > 0 && at[4]*at[5] > 0)
			c[cor] = "YES";
		else
			c[cor] = "NO";
		cor++;
	}
	for(i = 0;i < cor;i++)
		cout << c[i] << endl;
}