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 <cmath>
using namespace std;
#define EPS 1e-9

double get_distance( double x1, double y1, double x2, double y2 )
{
	return sqrt( ( x2 - x1 ) * ( x2 - x1 ) + ( y2 - y1 ) * ( y2 - y1 ) );
}

double get_sum( double x1, double y1, double x2, double y2, double x3, double y3 )
{
	double a = get_distance( x1, y1, x2, y2 );
	double b = get_distance( x2, y2, x3, y3 );
	double c = get_distance( x3, y3, x1, y1 );
	double s = ( a + b + c ) / 2;
	return sqrt( s * ( s - a ) * ( s - b ) * ( s - c ) );
}

int main( void )
{
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while ( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp )
	{
		double s = get_sum( x1, y1, x2, y2, x3, y3 );
		double s1 = get_sum( x1, y1, xp, yp, x2, y2 );
		double s2 = get_sum( x2, y2, xp, yp, x3, y3 );
		double s3 = get_sum( x3, y3, xp, yp, x1, y1 );

		if ( fabs( s - ( s1 + s2 + s3 ) ) <= EPS ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String args[])throws Exception{
        Scanner cin= new Scanner(System.in);
		
		while(cin.hasNextDouble()){
			double in[] = new double[8];
			for(int i=0;i<8;i++) in[i]= cin.nextDouble();
			int t1,t2,t3;
			t1= java.awt.geom.Line2D.relativeCCW(in[0],in[1],in[2],in[3],in[6],in[7]);
			t2= java.awt.geom.Line2D.relativeCCW(in[2],in[3],in[4],in[5],in[6],in[7]);
			t3= java.awt.geom.Line2D.relativeCCW(in[4],in[5],in[0],in[1],in[6],in[7]);
			if((t1==1 && t2==1 && t3==1) || (t1==-1 && t2==-1 && t3==-1)) System.out.println("YES");
			else System.out.println("NO");
		}
	}
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <set>
#include <cmath>

struct point
{
    point() : x(0), y(0) { }
    point(double x_, double y_) : x(x_), y(y_) { }
    double x, y;
};
point operator-(const point& a, const point& b) { return point(a.x - b.x, a.y - b.y); }
point operator+(const point& a, const point& b) { return point(a.x + b.x, a.y + b.y); }

bool greaterX(const point& a, const point& b) {
	if (a.x > b.x) return true;
	if (a.x < b.x) return false;
	return (a.y > b.y); 
}
bool greaterY(const point& a, const point& b) {
	if (a.y > b.y) return true;
	if (a.y < b.y) return false;
	return (a.x > b.x); 
}

void show(const point& a){ std::cout << '('<<a.x<<','<<a.y<<')'<<std::endl; }

typedef point vector2d;

double cross(const vector2d& a, const vector2d& b)
{
    return a.x * b.y - a.y * b.x;
}

bool greaterX_(const point& a, const point& b) {
	if (a.x > b.x) return true;
	if (a.x < b.x) return false;
	return (a.y < b.y); 
}

bool point_in_triangle(const point& p, const point& a, const point& b, const point& c)
{
    // p ª ab ÌE¤É êÎOp`ÌO¤É é
    if (cross(p - a, b - a) < 0.0) return false;
    // p ª bc ÌE¤É êÎOp`ÌO¤É é
    if (cross(p - b, c - b) < 0.0) return false;
    // p ª ca ÌE¤É êÎOp`ÌO¤É é
    if (cross(p - c, a - c) < 0.0) return false;
    return true;
}


int main(int,char**){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(std::cin >> x1){
		std::cin >>y1>>x2>>y2>>x3>>y3>>xp>>yp;
		std::vector<point> tri;
		tri.clear();
		tri.push_back(point(x1,y1));
		tri.push_back(point(x2,y2));
		tri.push_back(point(x3,y3));
		std::sort(tri.begin(),tri.end(),greaterX_);
		if(point_in_triangle(point(xp,yp),tri[2],tri[1],tri[0])) std::cout<< "YES"<<std::endl;
		else  std::cout<< "NO"<<std::endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <complex>
#define rep(i,n) for(int i=0; i<(n); i++)
#define EPS 1e-10
using namespace std;

typedef complex<double> cd;

double s(cd a, cd b){
  return a.real()*b.imag()-a.imag()*b.real();
}

int main(){
  cd a[4];

  for(;;){
    rep(i,4){
      double x,y;
      if(scanf(" %lf %lf", &x,&y)==EOF)
        return 0;
      a[i]=cd(x,y);
    }
    
    if((s(a[0]-a[3], a[1]-a[3]) > 0 && 
        s(a[1]-a[3], a[2]-a[3]) > 0 &&
        s(a[2]-a[3], a[0]-a[3]) > 0 ) ||
       (s(a[0]-a[3], a[1]-a[3]) < 0 && 
        s(a[1]-a[3], a[2]-a[3]) < 0 &&
        s(a[2]-a[3], a[0]-a[3]) < 0 ))
      printf("IN\n");
    else
      printf("OUT\n");
  }
  
  return 0;
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

double add_double(double a,double b){
	if(abs(a+b)<eps*(abs(a)+abs(b))) return 0;
	return a+b;
}

struct point{
	double x,y;
	point operator+(point p){
		return point{add_double(x,p.x),add_double(y,p.y)};
	}
	point operator-(point p){
		return point{add_double(x,-p.x),add_double(y,-p.y)};
	}
	point operator*(double p){
		return point{x*p,y*p};
	}
	point operator/(double p){
		if(!p) return point{0,0}; 
		return point{x/p,y/p};
	}
	bool operator==(point p){
		return fabs(add_double(x,-p.x))<eps&&fabs(add_double(y,-p.y))<eps;
	}
	bool operator<(point p){
		if(fabs(x-p.x)>eps) return x<p.x;
		return y<p.y;
	}
};
 
typedef pair<point,point> pp;
typedef vector<point> VP;
const point O{0,0};
 
class Geom{
	public:
	double Length(point x,point y){
		point z=y-x;
		return z.x*z.x+z.y*z.y;
	}
	double IP(point p,point q){
		return p.x*q.x+p.y*q.y;
	}
	double CP(point p,point q){
		return p.x*q.y-q.x*p.y;
	}
	string Containment_polyon_point(VP p,point x){
		bool flag=0;
		p.push_back(p[0]);
		for(VP::iterator i=p.begin();i!=p.end()-1;i++){
			point a=*i-x,b=*(i+1)-x;
			if(a.y>b.y) swap(a,b);
			double ip=IP(a,b),cp=CP(a,b);
			if(a.y<=0&&b.y>0&&cp<0) flag=!flag;
			if(cp<eps&&cp>-eps&&ip<=0) return "On_side";
		}
		return flag?"Containment":"not_Containment";
	}
	void Point_in(point& p){
		cin>>p.x>>p.y;
	}
	void Point_out(point p){
		cout<<p.x<<' '<<p.y<<endl;
	}
};

VP Tri(3);
point p;

int main(){
	Geom geo;
	while(cin>>Tri[0].x){
		cin>>Tri[0].y;
		geo.Point_in(Tri[1]);
		geo.Point_in(Tri[2]);
		geo.Point_in(p);
		string s=geo.Containment_polyon_point(Tri,p);
		if(s=="Containment") cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
}