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>
#include<vector>

struct Point
{
    double x;
 
    double y;
};
 
double Abs(double x)
{
    return x>=0 ? x : -x;
}
 
double Triangle(const Point& P, const Point& Q, const Point& R)
{
    Point A = {Q.x-P.x, Q.y-P.y};
 
    Point B = {R.x-P.x, R.y-P.y};
 
    return Abs(A.x*B.y-A.y*B.x);
}

void SwapPoint(Point& a, Point& b)
{
	Point temp={0,0};

	temp =a;

	a=b;

	b=temp;
}

int main()
{
	Point a, b, c, x;

	bool flg=1;//点Xが三角形の中にある=1

	while(std::cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> x.x >>x.y)
	{
		for(int i=0; i<3; ++i)
		{
			if(Triangle(a,b,c)<=Triangle(a,b,x)+Triangle(b,c,x))
			{
				flg=0;
			}

			SwapPoint(c,a);
			
			SwapPoint(b,c);
		}

		std::cout << (flg ? "YES\n" : "No\n");	
	}
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<sstream>
#include<cstdlib>
#include<cmath>
using namespace std;

class Biv {
private:
  void set(Biv v) {
    x = v.x; y = v.y;
  }
public:
  string toString() {
    stringstream ss;
    ss << "(" << x << ", " << y << ")";
    return ss.str();
  }
  double x, y;
  Biv(double xx, double yy) {
    x = xx; y = yy;
  }
  Biv() {
    x = 0; y = 0;
  }
  void operator=(Biv v) { set(v); }
  Biv operator-() {
    return Biv(-x, -y);
  }
  Biv operator+(Biv v) {
    return Biv(x + v.x, y + v.y);
  }
  Biv operator-(Biv v) {
    return *this + (-v);
  }
  Biv multiple(double k) {
    return Biv(k * x, k * y);
  }
  Biv operator+=(Biv v) {
    set(*this + v); return *this;
  }
  Biv operator-=(Biv v) {
    set(*this - v); return *this;
  }
  friend ostream& operator<<(ostream& os, const Biv& v);
  double length() {
    return sqrt(x * x + y * y);
  }
  double arg() {
    if (x == 0) { return (y < 0) ? - M_PI: M_PI; }
    return atan(y / x);
  }
};

double dot(Biv a, Biv b) {
  return a.x * b.x + a.y * b.y;
}

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

class Ttm {
private:
  void set(Ttm m) {
    a = m.a; b = m.b; c = m.c; d = m.d;
  }
public:
  double a, b, c, d;
  string toString() {
    stringstream ss;
    ss << "[" << a << "," << b << "," << c << "," << d << "]";
    return ss.str();
  }
  Ttm(double aa, double bb, double cc, double dd) {
    a = aa; b = bb; c = cc; d = dd;
  }
  Ttm() {
    a = 0; b = 0; c = 0; d = 0;
  }
  void operator=(Ttm m) { set(m); }
  Ttm operator-() {
    return Ttm(-a, -b, -c, -d);
  }
  Ttm operator+(Ttm m) {
    return Ttm(a+m.a, b+m.b, c+m.c, d+m.d);
  }
  Ttm operator-(Ttm m) {
    return *this + (-m);
  }
  Ttm operator*(Ttm m) {
    return Ttm(a*m.a+b*m.c, a*m.b+b+m.d, c*m.a+d*m.c, c*m.d+d*m.d);
  }
  Biv operator*(Biv v) {
    return Biv(a * v.x + b * v.y, c * v.x + d * v.y);
  }
  Ttm multiple(double k) {
    return Ttm(k*a, k*b, k*c, k*d);
  }
  Ttm operator+=(Ttm m) {
    set(*this + m); return *this;
  }
  Ttm operator-=(Ttm m) {
    set(*this - m); return *this;
  }
};

Ttm Rotate(double t) {
  return Ttm(cos(t), -sin(t), sin(t), cos(t));
}

bool in(Biv a, Biv b, Biv c, Biv p) {
  b -= a;
  c -= a;
  p -= a;
  
  if (cross(b,p) * cross(c,p) >= 0) {
    /*cout << "cross(" << b.toString() << "," << p.toString()
      << ") * cross(" << c.toString() << "," << p.toString() << ") > 0" << endl;*/
    return false; }
  
  double t = b.arg();
  /*cout << t << " "<< Rotate(-t).toString() << endl;*/
  c = Rotate(-t) * c;
  p = Rotate(-t) * p;
  /*cout << "c="<<c.toString() << " ,p=" <<p.toString();*/

  return (p.x < c.x);
}


int main() {
  Biv p1, p2, p3, pp;

  while(cin >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y >> pp.x >> pp.y) {
    bool yes = in(p1, p2, p3, pp);

    cout << ( yes ? "YES" : "NO") << endl;
  }
}

C++: #include <iostream>


bool checkSlope(double x1,double y1 ,double x2 ,double y2,double x3,double y3 ,double x,double y){
	double slope1 = (y2-y1)/(x2-x1);
	double slope2 = (y3-y1)/(x3-x1);
	double slopep = (y-y1)/(x-x1);

	if(slope1 > slope2){
					if(slope1 > slopep && slopep > slope2){
									return true;
					}else{
									return false;
					}
	}else{
					if(slope2 > slopep && slopep > slope1){
									return true;
					}else{
									return false;
					}
	}
}


int main(int argc, char *argv[])
{
	double x1,x2,x3,y1,y2,y3,x,y;

	while(std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y){

	bool flag[3];

	flag[0] = checkSlope(x1,y1,x2,y2,x3,y3,x,y);
	flag[1] = checkSlope(x2,y2,x1,y1,x3,y3,x,y);
	flag[2] = checkSlope(x3,y3,x1,y1,x2,y2,x,y);

	bool fukumu;

	for(int i = 0; i < 3; i++){
					if(flag[i]=true){
									fukumu = true;
					}else{
									fukumu = false;
									break;
					}
	}

	if(fukumu=true){
					std::cout << "YES" << std::endl;
	}else{
					std::cout << "NO" << std::endl;
	}

}
}

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");
   else
     printf ("NO");
      }

   return 0;
}