Go: package main

import (
        "fmt"
)

func main() {
        var x1, y1, x2, y2, x3, y3, px, py float64
        var oax, oay, obx, oby, opx, opy float64
        var det float64
        var s, t float64

        for {
                _, err := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &px, &py)
                if err != nil {
                        break
                }
                oax = x2 - x1
                oay = y2 - y1
                obx = x3 - x1
                oby = y3 - y1
                opx = px - x1
                opy = py - y1
                det = oax*oby - obx*oay

                if det == 0 {
                        fmt.Printf("NO\n")
                } else {
                        s = (oby*opx - obx*opy) / det
                        t = (oax*opy - oay*opx) / det

                        if (s+t < 1 && s > 0 && t > 0) {
                                fmt.Printf("YES\n")
                        } else {
                                fmt.Printf("NO\n")
                        }
                }
        }
}

C++: #include <iostream>

using namespace std;

template <typename T>
struct Vector2
{
// variable
public:
	T x;
	T y;

// structor
public:
	Vector2(const Vector2& other) :
		x(other.x),
		y(other.y)
	{

	}

	Vector2(T x = 0, T y = 0) :
		x(x),
		y(y)
	{

	}

// operator
public:
	Vector2 operator-(const Vector2<T>& rhs) const
	{
		return Vector2(x - rhs.x, y - rhs.y);
	}

	Vector2& operator=(const Vector2<T>& rhs)
	{
		x = rhs.x;
		y = rhs.y;
		return *this;
	}
};

template <typename T>
ostream& operator<< (ostream& stream, const Vector2<T>& rhs)
{
	stream << '(' << rhs.x << ", " << rhs.y << ')';
	return stream;
}

template <typename T>
istream& operator>> (istream& stream, Vector2<T>& rhs)
{
	stream >> rhs.x >> rhs.y;
	return stream;
}

template <typename T>
int relation(const Vector2<T>& p1, const Vector2<T>& p2)
{
	T product = p1.x * p2.y - p1.y * p2.x;
		
	return
		product == 0 ? 0 : (product > 0 ? 1 : -1);
}

int main()
{
	Vector2<double> a, b, c, p;
	while(cin >> a >> b >> c >> p)
	{
		if
		(
			(relation(b-a, b-p) > 0 && relation(c-b, b-p) > 0 && relation(a-c, a-p) > 0) &&
			(relation(b-a, b-p) <= 0 && relation(c-b, b-p) <= 0 && relation(a-c, a-p) <= 0) 
		)
			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 ab = sub_vector(v[1] , v[0]);
		Vector bp = sub_vector(v[3] , v[1]);
		Vector bc = sub_vector(v[2] , v[1]);
		Vector cp = sub_vector(v[3] , v[2]);
		Vector ca = sub_vector(v[0] , v[2]);
		Vector ap = sub_vector(v[3] , v[0]);
		double c1 = ab.x * ap.y - ab.y * ap.x; //??????
		double c2 = bc.x * bp.y - bc.y * bp.x;
		double c3 = ca.x * cp.y - ca.y * cp.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 <iostream>
using namespace std;

bool ss(double a, double b, double c, double u, double v, double x, double y) {
	if ((a * u + b * v + c) * (a * x + b * y + c) > 0) {
		return true;
	}
	else
		return false;
}

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

	return 0;
}

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

using namespace std;

struct Point2D {
  double x,y;

  Point2D operator-(Point2D &p);
  friend istream &operator>>(istream &is, Point2D &t);
  friend double cross(Point2D &a, Point2D &b);
};

Point2D Point2D::operator-(Point2D &p) {
  Point2D t;
  t.x = x - p.x;
  t.y = y - p.y;
  return t;
}

istream &operator>>(istream &is, Point2D &t) {
  is >> t.x >> t.y;
  return is;
}

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

int judge(double t) {
  if(t>0.0) return 1;
  else if(t<0.0) return -1;
  else return 0;
}

int main() {
  vector<Point2D> t(3);
  Point2D p;
  
  while(cin >> t[0] >> t[1] >> t[2] >> p) {
    int key = 0;
        
    for(int i = 0; i < 3; i++) {
      Point2D m = t[i] - t[( i + 1 ) % 3];
      Point2D n = t[i] - p;
      key += judge(cross(m, n));
    }
    cout << ((abs(key) == 3) ? "YES" : "NO") << endl;
  }
  
  return 0;
}

C++: #include<stdio.h>
int main(){
	double x1,x2,x3,x4,y1,y2,y3,y4;
	while(~scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4)){
		bool ok=true;
		if(x1*y4-x4*y1<0)ok=false;
		if(x2*y4-x4*y2<0)ok=false;
		if(x3*y4-x4*y3<0)ok=false;
		printf(ok?"NO\n":"YES\n");
	}
}

C++: #include <iostream>
#include <cmath>
#define mul(s, t) ((s-t)*(s-t))

using namespace std;

int main()
{
	double x[3], y[3], u[2], s, t, v;
	
	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> s >> t){
		bool f = true;
		for(int i = 0; i < 3; i++){
			int p = 0;
			for(int j = 0; j < 3; j++){
				if(i != j){
					u[p++] = sqrt(mul(x[i], x[j])+mul(y[i], y[j]));
				}
			}
			v = sqrt(mul(x[i], s)+mul(y[i], t));
			
			if(u[0] <= v || u[1] <= v){
				f = false;
				break;
			}
		}
		cout << ((f)? "YES" : "NO") << endl;
	}
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  double a,b,c,d,e,f,x,y;
  double s,t;

  while(cin>>a>>b>>c>>d>>e>>f>>x>>y){
    s=((e-d)*(x-c)-(e-c)*(y-d))/((a-c)*(e-d)-(e-c)*(b-d));
    t=((a-c)*(y-d)-(b-d)*(x-c))/((a-c)*(e-d)-(e-c)*(b-d));

    if(0<s+t&&s+t<1){
      cout<<"YES"<<endl;
    }
    else{
      cout<<"NO"<<endl;
    }
  }
  return 0;
}

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

struct Vec2d{
  double x,y;
};

double cross(Vec2d &A, Vec2d &B){
  return A.x*B.y - A.y*B.x;
}

int main(void){
  double x1,y1,x2,y2,x3,y3,xp,yp;
  while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
	  Vec2d AB,AP,BC,BP,CA,CP;
	  AB.x = x2-x1; AB.y = y2-y1;
	  BC.x = x3-x2; BC.y = y3-y2;
	  CA.x = x1-x3; CA.y = y1-y3;
	  AP.x = xp-x1; AP.y = yp-y1;
	  BP.x = xp-x2; BP.y = yp-y2;
	  CP.x = xp-x3; CP.y = yp-y3;
	  if(fabs(cross(AB,AP))>0.0 
	  && fabs(cross(BC,BP))>0.0
	  && fabs(cross(CA,CP))>0.0)
	  	cout<<"YES"<<endl;
	  else
	  	cout<<"NO"<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cmath>
#define EPS 1.0e-5
using namespace std;

int main() {
  double x1,y1,x2,y2,x3,y3,xp,yp;
  double a[2],b[2];
  double A,B;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    //    cout << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << " " << xp << " " << yp << endl;
    a[0] = x2 - x1;
    a[1] = y2- y1;
    b[0] = x3 - x1;
    b[1] = y3 - y1;
    if(fabs(a[0]*b[0]+a[1]*b[1]) != 1) {
      A = ( b[1] * (xp-x1) - b[0] * (yp-y1)) / (a[0] * b[1] - b[0] * a[1]);
      B = (a[1] * (xp-x1) - (yp-y1) * a[0]) / (a[1] * b[0] - b[1] * a[0]);
      if ((A+B < 1) && (A > 0) && (B > 0)) {
        cout << "YES" << endl;
      }
      else {
        cout << "NO" << endl;
      }
    }
    else
      cout << "NO" << endl;
  }
}