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++: /**************** Geometrical Library ****************/

#include<cmath>
#include<vector>
#include<algorithm>

#define	EPS	1e-8

enum {CCW=1,CW=-1,ON=0};

#define	mp	make_pair
#define	pb	push_back

using namespace std;

class Point{
public:
	double x,y;
	Point(){}
	Point(double xx,double yy):x(xx),y(yy){}
};

class Line:public vector<Point>{
public:
	Line(const Point &a,const Point &b){
		pb(a),pb(b);
	}
};

class Segment:public Line{
public:
	Segment(const Point &a,const Point &b):Line(a,b){}
};

class Polygon:public vector<Point>{};

class Circle{
public:
	Point c;
	double r;
	Circle(const Point &cc,double rr) : c(cc),r(rr){}
};

Point &operator +=(Point &a,const Point &b){
	a.x+=b.x,a.y+=b.y;
	return a;
}

Point &operator -=(Point &a,const Point &b){
	a.x-=b.x,a.y-=b.y;
	return a;
}

Point &operator *=(Point &a,double c){
	a.x*=c,a.y*=c;
	return a;
}

Point &operator /=(Point &a,double c){
	a.x/=c,a.y/=c;
	return a;
}

Point operator +(const Point &a,const Point &b){
	Point c=a;
	return c+=b;
}

Point operator -(const Point &a,const Point &b){
	Point c=a;
	return c-=b;
}

Point operator *(double c,const Point &a){
	Point b=a;
	return b*=c;
}

Point operator /(const Point &a,double c){
	Point b=a;
	return b/=c;
}

bool operator <(const Point &a,const Point &b){
	return (a.x==b.x)?(a.y<b.y):(a.x<b.x);
}

bool operator >(const Point &a,const Point &b){
	return b<a;
}

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

int ccw(const Point &a,Point b,Point c){
	b-=a,c-=a;
	double rotdir=cross(b,c);
	if(rotdir>EPS)		return CCW;
	if(rotdir<-EPS)		return CW;
	return ON;
}

/**************** Library END ****************/

#include<cstdio>

int main(){
	for(Point a,b,c,p;~scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y,&p.x,&p.y);){
		int cnt=0;
		cnt+=ccw(a,b,p);
		cnt+=ccw(b,c,p);
		cnt+=ccw(c,a,p);
		puts((cnt==3*CCW || cnt==3*CW)?"YES":"NO");
	}
	return 0;
}

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

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

C++: #include <stdio.h>
#include <stdlib.h>
#include<iostream>
#include<math.h>
#include<vector>
using namespace std;
/* A utility function to calculate area of triangle formed by (x1, y1),
   (x2, y2) and (x3, y3) */
float area(float x1, float y1, float x2, float y2, float x3, float y3)
{
   return fabs((x1*(y2-y3) + x2*(y3-y1)+ x3*(y1-y2))/2.0);
}

/* A function to check whether point P(x, y) lies inside the triangle formed
   by A(x1, y1), B(x2, y2) and C(x3, y3) */
bool isInside(float x1, float y1, float x2, float y2, float x3, float y3, float x, float y)
{
   /* Calculate area of triangle ABC */
   float A = area (x1, y1, x2, y2, x3, y3);
    //cout<<A<<endl;
   /* Calculate area of triangle PBC */
   float A1 = area (x, y, x2, y2, x3, y3);//cout<<A1<<endl;

   /* Calculate area of triangle PAC */
   float A2 = area (x1, y1, x, y, x3, y3);//cout<<A2<<endl;

   /* Calculate area of triangle PAB */
   float A3 = area (x1, y1, x2, y2, x, y);//cout<<A3<<endl;
   //cout<<A1+A2+A3<<endl;

   /* Check if sum of A1, A2 and A3 is same as A */
   return (A == A1 + A2 + A3);
}

/* Driver program to test above function */
int main()
{
   /* Let us check whether the point P(10, 15) lies inside the triangle
      formed by A(0, 0), B(20, 0) and C(10, 30) */
      float x1, y1, x2 , y2, x3, y3,xp,yp;
      while(scanf("%f %f %f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)==8){
   if (isInside(x1, y1, x2, y2, x3, y3,xp,yp))
     printf ("YES\n");
   else
     printf ("NO\n");
      }

   return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <deque>
#include <functional>


using namespace std;

int main()
{
	double x1,y1,x2,y2,x3,y3,xp,yp;
	
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
	{
		deque<double> nums;
		nums.push_back(x1);
		nums.push_back(x2);
		nums.push_back(x3);
		sort( nums.begin(), nums.end());
		
		deque<double>::iterator it = nums.begin();
		double a,b,c,d;

		a = *it;
		it += 2;
		b = *it;

		nums.clear();

		nums.push_back(y1);
		nums.push_back(y2);
		nums.push_back(y3);
		sort( nums.begin(), nums.end());
		
		it = nums.begin();
		c = *it;
		it += 2;
		d = *it;

		int ture=0;
		
		if(xp<a) ;
		else if(b<xp);
		else ture++;

		if(yp<c) ;
		else if(d<yp);
		else ture++;

		if(ture==2) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;

		nums.clear();

	}

	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 abs( a.real()*b.imag()-a.imag()*b.real() );
}

int main(){
  cd a[4];
  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)!=EOF){
    a[0] = cd(x1,y1);
    a[1] = cd(x2,y2);
    a[2] = cd(x3,y3);
    a[3] = cd(xp,yp);
    if(abs(s(a[0]-a[3], a[1]-a[3])
           + s(a[1]-a[3], a[2]-a[3])
           + s(a[2]-a[3], a[0]-a[3])
           - s(a[1]-a[0], a[2]-a[0])) < EPS )
      printf("YES\n");
    else
      printf("NO\n");
  }
  
  return 0;
}

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

#define ll long long
#define LL long long
#define ULL unsigned long long 
#define ull unsigned long long 
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define int(x) int x;scanf("%d",&x);
#define double(x) double x;scanf("%lf",&x);
#define string(x) double string;cin>>x;

using namespace std;

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

		double x_max, x_min, y_max, y_min;
		x_max = max(x1, max(x2, x3));
		x_min = min(x1, min(x2, x3));
		y_max = max(y1, max(y2, y3));
		y_min = min(y1, min(y2, y3));

		if (xp < x_max&&xp > x_min&&yp > y_min&&yp < y_max) {
			cout << "YES\n";
		}
		else {
			cout << "NO\n";
		}
	}

	return 0;
}

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

int main() {
  double x1, y1, x2, y2, x3, y3, xp, yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    if (((x2 - x1) * (yp - y2) - (y2 - y1) * (xp - x2) > 0 &&
         (x3 - x2) * (yp - y3) - (y3 - y2) * (xp - x3) > 0 &&
         (x1 - x3) * (yp - y1) - (y1 - y3) * (xp - x1) > 0) ||
        ((x2 - x1) * (yp - y2) - (y2 - y1) * (xp - x2) < 0 &&
         (x3 - x2) * (yp - y3) - (y3 - y2) * (xp - x3) < 0 &&
         (x1 - x3) * (yp - y1) - (y1 - y3) * (xp - x1) < 0))
      cout << "YES\n";
    else
      cout << "NO\n";
  }

  return 0;
}