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 <cstdio>
#include <vector>
#include <algorithm>
#include <complex>

using namespace std;

static const double EPS=1e-12;
static const double INF=1e24;

using Point=complex<double>;
using Plane=vector<Point>;

namespace std {
    bool operator<(const Point &a, const Point &b) {
        return real(a)!=real(b)? real(a)<real(b) : imag(a)<imag(b);
    }
}

double cross_prod(const Point &a, const Point &b) {
    return imag(conj(a)*b);
}

double dot_prod(const Point &a, const Point &b) {
    return real(conj(a)*b);
}

struct Line: public pair<Point, Point> {
    Line() {}
    Line(const Point &a, const Point &b) {
        first = a;
        second = b;
    }
};

struct LineSeg: public pair<Point, Point> {
    LineSeg() {}
    LineSeg(const Point &a, const Point &b) {
        first = a;
        second = b;
    }
};

struct Circle {
    Point p;
    double r;
    Circle() {}
    Circle(const Point &p, const double r): p(p), r(r) {}
};

enum CCWiseState {
    ONLINE_FRONT=-2,
    CLOCKWISE,
    ON_SEGMENT,
    COUNTER_CLOCKWISE,
    ONLINE_BACK,
};

CCWiseState ccwise(Point a, Point b, Point c) {
    b -= a; c -= a;

    if (cross_prod(b, c) > 0) {
        return COUNTER_CLOCKWISE;
    } else if (cross_prod(b, c) < 0) {
        return CLOCKWISE;
    } else if (dot_prod(b, c) < 0) {
        return ONLINE_BACK;
    } else if (norm(b) < norm(c)) {
        return ONLINE_FRONT;
    } else {
        return ON_SEGMENT;
    }
}

bool testcase_ends() {
    double x, y;
    if (scanf("%lf %lf", &x, &y) == EOF)
        return 1;

    Point A(x, y);
    scanf("%lf %lf", &x, &y);
    Point B(x, y);
    scanf("%lf %lf", &x, &y);
    Point C(x, y);

    scanf("%lf %lf", &x, &y);
    Point P(x, y);

    CCWiseState tmp=ccwise(A, P, B);
    if (tmp != ccwise(B, P, C)) {
        return !printf("NO\n");
    } else if (tmp != ccwise(C, P, A)) {
        return !printf("NO\n");
    }

    printf("YES\n");
    return 0;
}

int main() {
    int solved=0;
    while (!testcase_ends())
        ++solved;

    return !solved;
}

C++: #include<algorithm>
#include<iostream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
bool pt(double px,double py,double qx,double qy,double rx,double ry,double sx,double sy){
  if(((rx-qx)*(py-qy)-(px-qx)*(ry-qy)<=0&&(sx-rx)*(py-ry)-(px-rx)*(sy-ry)<=0&&(qx-sx)*(py-sy)-(px-sx)*(qy-sy)<=0)||
     ((rx-qx)*(py-qy)-(px-qx)*(ry-qy)>=0&&(sx-rx)*(py-ry)-(px-rx)*(sy-ry)>=0&&(qx-sx)*(py-sy)-(px-sx)*(qy-sy)>=0))
    return 1;
  return 0;
}
int main(){
  double px,py,qx,qy,rx,ry,sx,sy;
  while(cin>>qx>>qy>>rx>>ry>>sx>>sy>>px>>py){
    if(pt(px,py,qx,qy,rx,ry,sx,sy))
      cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

double area2(const double x[][2]){
        double y[3][2];
        for(int i = 0; i < 3; i++){
                for(int j = 0; j < 2; j++){
                        y[i][j] = x[i][j];
                }   
        }   
        for(int i = 0; i < 3; i++){
                y[i][0] -= y[2][0];
                y[i][1] -= y[2][1];
        }   
        double s = y[0][0]*y[1][1]-y[0][1]*y[1][0];
        if(s < 0){ 
                s = -s; 
        }   
        return s;
}
bool isIn(double x[][2]){
        double x1[][2] = {{x[0][0], x[0][1]}, {x[1][0], x[1][1]}, {x[3][0], x[3][1]}};
        double x2[][2] = {{x[0][0], x[0][1]}, {x[2][0], x[2][1]}, {x[3][0], x[3][1]}};
        double s = area2(x) - area2(x+1) - area2(x1) - area2(x2);
        return !s; 
}
int main(){
        double x[4][2];
        while(cin >> x[0][0]){
                cin >> x[0][1];
                for(int i = 1; i < 4; i++){
                        for(int j = 0; j < 2; j++){
                                cin >> x[i][j];
                        }   
                }   
                if(isIn(x)){
                        cout << "YES" << endl;
                }else{
                        cout << "NO" << endl;
                }   
        }   
}

C++: #include <cstdio>
#include <iostream>
#include <cmath>
#include <cstdlib>

#define P(a) ((a)*(a))
using namespace std;

typedef struct {
    double x;
    double y;
}Point;

double length(Point a,Point b){
    return sqrt(P(b.x-a.x)+P(b.y-a.y));
}

double heron(Point a,Point b,Point c){
    double d,e,f,s;
    d=length(a,b);
    e=length(b,c);
    f=length(c,a);
    s=(d+e+f)/2.0;
    return sqrt(s*(s-d)*(s-e)*(s-f));
}
int main(){
    Point p[3],q;

    while(cin >> p[0].x >> p[0].y >> p[1].x >> p[1].y >> p[2].x >> p[2].y >> q.x >> q.y){
        double Tarea,Carea;
        Tarea=heron(p[0], p[1], p[2]);
        Carea=heron(p[0],p[1],q)+heron(p[1],p[2],q)+heron(p[2],p[0],q);
        if(fabs(Tarea-Carea)<0.0000000000001) printf("YES\n");
        else printf("NO\n");
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#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 PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){

    double x[4],y[4];
    while(true){
	REP(i,4) {
	    cin >> x[i];
	    if(cin.eof()) return 0;
	    cin >> y[i];
	}
	double s,t;
	bool flg = false;
	REP(i,1e6){
	    s = ((double)i/1e6);
	    t = (double)1 - s;
	    double x1 = s * (x[2] - x[0]) + t * ( x[1] - x[0]);
	    double y1 = s * (y[2] - y[0]) + t * ( y[1] - y[0]);
	    double x2 = x[3] - x[0];
	    double y2 = y[3] - y[0];
	    double dotpro = (  (  (x1 * x2 + y1 * y2 )*(x1 * x2 + y1 * y2 ) )  /( (x1*x1 + y1*y1)*(x2*x2 + y2*y2)));
        if( (x2 * x2 + y2 * y2) >= (x1*x1 + y1 * y1)) continue;
	    if(  abs(1 - sqrt(dotpro))  <= 0.000001  ){
//		cout << dotpro << endl;
		    flg = true;
		    break;
	    }
	}
	if(flg) cout << "YES" << endl;
	else cout << "NO" << endl;

    }

    return 0;
}

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

typedef complex<double> P;

double cross(const P& a, const P& b) {
	return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
	return real(conj(a)*b);
}

int ccw(P a, P b, P c) {
	b -= a; c -= a;
	if (cross(b, c) > 0)		return +1;		// counter clockwise
	if (cross(b, c) < 0)		return -1;		// clockwise
	if (dot(b, c) < 0)		return +2;		// c--a--b on line
	if (norm(b) < norm(c))	return -2;		// a--b--c on line
	return 0;
}

int main(){
	P p[3],t;
	while(cin >> p[0].real() >> p[0].imag() >> p[1].real() >> p[1].imag() >> p[2].real() >> p[2].imag() >> t.real()>> t.imag()){
		int x=0;
		for(int i=0;i<3;i++) x += ccw(p[i],p[(i+1)%3],t);
		if(x==3||x==-3) cout<<"YES"<<endl;
		else cout<< "NO" <<endl;
		}
	return 0;
}