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 <stdio.h>
#include <stdlib.h>
#include<iostream>
#include<math.h>
#include<vector>
using namespace std;

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);
}


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 (x, y, x1, y1, x3, y3);//cout<<A2<<endl;

    /* Calculate area of triangle PAB */
    float A3 = area (x,y,x1, y1, x2, y2);//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 <stdio.h>

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	double s, t;

	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF) {
		s = ((xp - x1) * (y3 - y1) - (yp - y1) * (x3 - x1)) /
				((x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1));

		t = ((xp - x1) * (y2 - y1) - (yp - y1) * (x2 - x1)) /
				((x3 - x1) * (y2 - y1) - (x2 - x1) * (y3 - y1));

		if(s > 0 && t > 0 && s + t < 1)
			printf("YES\n");
		else
			printf("NO\n");
	}

	return 0;
}

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

struct point{
	double x;
	double y;
};

int ccw(point p0, point p1, point p2){
	double dx1, dx2, dy1, dy2;
	dx1 = p1.x - p0.x;
	dy1 = p1.y - p0.y;
	dx2 = p2.x - p0.x;
	dy2 = p2.y - p0.y;
	if(dx1 * dy2 > dy1 * dx2) return 1;
	else return -1;
}

int main(){
	point p1, p2, p3, p0;
	while(cin >> p1.x >> p1.y >> p2.x >>p2.y
		>> p3.x >> p3.y >> p0.x >> p0.y)
	{
		if((ccw(p0, p1, p2 ) != ccw(p0, p1, p3))
			&& (ccw(p0, p2, p1) != ccw(p0, p2, p3)))
			cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <iostream>
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) {
    a[0] = x2 - x1;
    a[1] = y2- y1;
    b[0] = x3 - x1;
    b[1] = y3 - y1;
    //vect[0] = A * a[0] + B * b[0];
    //vect[1] = A * a[1] + B * b[1];
    A = (xp * b[1] - b[0] * yp) / (a[0] * b[1] - b[0] * a[1]);
    B = (a[0] * yp - xp * a[1]) / (a[0] * b[1] - b[0] * a[1]);
    if ((A+B <= 1) && (A > 0) && (B > 0)) {
      cout << "YES" << endl;
    }
    else {
      cout << "NO" << endl;
    }
  }
}

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

class point{ // as necessary
	private:
		static const double EPS=1e-5;
	public:
		static const int COUNTER_CLOCKWISE=1;
		static const int CLOCKWISE=-1;
		static const int ONLINE_BACK=2;
		static const int ONLINE_FRONT=-2;
		static const int ON_SEGMENT=0;

		double x;
		double y;
		point(double x=0,double y=0):x(x),y(y){}

		point operator+(point p){return point(x+p.x,y+p.y);}
		point operator-(point p){return point(x-p.x,y-p.y);}
		point operator*(const double a){return point(x*a,y*a);}
		point operator/(const double a){return point(x/a,y/a);}

		static double dot(const point &p1,const point &p2){
			return p1.x*p2.x+p1.y*p2.y;
		}

		double norm(){
			return x*x+y*y;
		}

		double abs(){
			return sqrt(norm());
		}

		static double cross(point p1,point p2){
			return p1.x*p2.y-p1.y*p2.x;
		}

		static int ccw(point p0,point p1,point p2){
			point a=p1-p0; // ??????p0p1
			point b=p2-p0; // ??????p0p2
			if(cross(a,b)>EPS) return COUNTER_CLOCKWISE; // a????????????b??????????¨?
			if(cross(a,b)<-EPS) return CLOCKWISE; // a????????????b???????¨?
			if(dot(a,b)<-EPS) return ONLINE_BACK; // p2-p0-p1???????????¢???
			if(a.norm(),b.norm()) return ONLINE_FRONT; // p0-p1-p2???????????¢???
			return ON_SEGMENT; // p0-p2-p1???????????¢???
		}
};

int main(void){
	double x,y;
	while(cin>>x>>y){
		int rcw=0;
		int cw=0;
		point a(x,y);
		cin>>x>>y;
		point b(x,y);
		cin>>x>>y;
		point c(x,y);
		cin>>x>>y;
		point d(x,y);
		switch(point::ccw(d,a,b)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		switch(point::ccw(d,b,c)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		switch(point::ccw(d,c,a)){
			case point::COUNTER_CLOCKWISE:rcw++;break;
			case point::CLOCKWISE:cw++;break;
		}
		if(rcw==1&&cw==2)cout<<"NO"<<endl;
		else cout<<"YES"<<endl;
	}
}

C++: #include <iostream>
using namespace std;
bool judge_Cross(double, double, double, double);

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		double pax = x1 - xp;
		double pay = y1 - yp;
		double pbx = x2 - xp;
		double pby = y2 - yp;
		double pcx = x3 - xp;
		double pcy = y3 - yp;

		if ((judge_Cross(pax, pay, pbx, pay) && judge_Cross(pbx, pby, pcx, pcy) && judge_Cross(pcx, pcy, pax, pay)) ||
			!((judge_Cross(pax, pay, pbx, pay) || judge_Cross(pbx, pby, pcx, pcy) || judge_Cross(pcx, pcy, pax, pay)))) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}

	return 0;
}

bool judge_Cross(double x1,double y1,double x2,double y2) {
	if (x1 * y2 - x2 * y1 > 0.0) {
		return true;
	} else {
		return false;
	}
}