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<algorithm>
using namespace std;
double x[4],y[4],r[3];
void che(a,b){
	if(x[a]>x[b]){
		swap(x[a],x[b]);
		swap(y[a],y[b]);
	}
}
int main(){
	int m=0;
	while(cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>x[3]>>y[3]){
		che(0,1);
		che(1,2);
		che(0,1);
		if(y[0]<=y[3] && y[3]<=y[1]){
			r[0]=x[0]+(x[2]-x[0])*(y[3]-y[0])/(y[2]-y[0]);
			r[1]=x[0]+(x[1]-x[0])*(y[3]-y[0])/(y[1]-y[0]);
			if(r[0]>r[1])swap(r[0],r[1]);
		}else if(y[1]<=y[3] && y[3]<=y[2]){
			r[0]=x[2]+(x[0]-x[2])*(y[2]-y[3])/(y[2]-y[0]);
			r[1]=x[2]+(x[1]-x[2])*(y[2]-y[3])/(y[2]-y[1]);
			if(r[0]>r[1])swap(r[0],r[1]);
		}else{
			cout<<"NO"<<endl;
			continue;
		}
		if(r[0]<=x[3] && x[3]<=r[1]){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

double cross(double x1,double y1,double x2,double y2)
{
	return x1*y2-x2*y1;
}

bool ccw(double x1,double y1,double x2,double y2,double x3,double y3)
{
	return cross(x2-x1,y2-y1,x3-x1,y3-y1)>0;
}

int main()
{
	for(string s;getline(cin,s);){
		istringstream iss(s);
		vector<double> x(3),y(3);
		rep(i,3)
			iss>>x[i]>>y[i];
		double xp,yp;
		iss>>xp>>yp;
		
		bool in_triangle=true;
		rep(i,3){
			if(ccw(x[0],y[0],x[1],y[1],xp,yp)!=ccw(x[1],y[1],x[2],y[2],xp,yp))
				in_triangle=false;
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}
		
		cout<<(in_triangle?"YES":"NO")<<endl;
	}
	
	return 0;
}

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

bool hantei( double x1, double y1, double x2, double y2, double x3, double y3 ) {
  if ( (x1-x2)*(y3-y2) > (y1-y2)*(x3-x2) ) return true;
  return false;
}

int main() {

  double x1,y1,x2,y2,x3,y3,xp,yp;

  while( cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp ) {

    for ( int i = 0; i < 3; i++ ) {
      if ( hantei( x1, y1, x2, y2, x3, y3 ) != hantei( x1, y1, x2, y2, xp, yp ) ) {
	cout << "NO" << endl;
	break;
      }
      if ( i != 2 ) {
	double k;
	k = x1;
	x1 = x2;
	x2 = x3;
	x3 = k;
	k = y1;
	y1 = y2;
	y2 = y3;
	y3 = k;
      }else {
	cout << "YES" << endl;
      }
    }

  }

  return 0;

}

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

double getd(double x, double y){
	double r = atan2(y, x) * 180 / M_PI;
	return r;
}

int main(){
	printf("%lf\n", getd(2,4));
	printf("%lf\n", getd(-1,0));
	printf("%lf\n", getd(2,2));
	printf("%lf\n", getd(2,-2));
	printf("%lf\n", getd(-2,-2));
	printf("%lf\n", getd(-2,2));
	

	double x1,y1,x2,y2,x3,y3,xp,yp,d1,d2,d3;
	double h;
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp) + 1){
		x1 -= xp;
		x2 -= xp;
		x3 -= xp;
		y1 -= yp;
		y2 -= yp;
		y3 -= yp;
		d1 = getd(x1,y1);
		d2 = getd(x2,y2);
		d3 = getd(x3,y3);
		if(d1 > d2){
			h = d1;
			d1 = d2;
			d2 = h;
		}
		if(d2 > d3){
			h = d2;
			d2 = d3;
			d3 = h;
			if(d1 > d2){
				h = d1;
				d1 = d2;
				d2 = h;
			}
		}
		d2 -= d1;
		d3 -= d1;
		if(180 > d2){
			if(180 < d3 && d3 < d2 + 180){
				printf("YES\n");
			}else{
				printf("NO\n");
			}
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>

const static double	de_PI	= 3.14159265358979323846;
const static int	de_MOD	= 1000000007;
const static int	de_MAX	= 999999999;
const static int	de_MIN = -999999999;

struct VECTOR {
	double x;
	double y;
	double z;
};

inline VECTOR RelativePositionVector(const VECTOR A, const VECTOR B) {

	VECTOR v;
	v.x = B.x - A.x;
	v.y = B.y - A.y;
	v.z = B.z - A.z;

	return(v);

}

inline VECTOR CrossProduct(const VECTOR A,const VECTOR B) {

	VECTOR v;
	v.x = A.y*B.z - A.z*B.y;
	v.y = A.z*B.x - A.x*B.z;
	v.z = A.x*B.y - A.y*B.x;

	return(v);

}

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());

	VECTOR A, B, C, P;
	A.z = B.z = C.z = P.z = 0;
	std::vector<std::string> ans;

	while (std::cin >> A.x) {

		std::cin >> A.y >> B.x >> B.y >> C.x >> C.y >> P.x >> P.y;
		
		VECTOR AB = RelativePositionVector(A, B);
		VECTOR AP = RelativePositionVector(A, P);
		VECTOR BC = RelativePositionVector(B, C);
		VECTOR BP = RelativePositionVector(B, P);
		VECTOR CA = RelativePositionVector(C, A);
		VECTOR CP = RelativePositionVector(C, P);

		VECTOR ABxAP = CrossProduct(AB, AP);
		VECTOR BCxBP = CrossProduct(BC, BP);
		VECTOR CAxCP = CrossProduct(CA, CP);

		if (ABxAP.z > 0 && BCxBP.z > 0 && CAxCP.z > 0) {
			ans.push_back("YES");
		}
		else if (ABxAP.z < 0 && BCxBP.z < 0 && CAxCP.z < 0) {
			ans.push_back("YES");
		}
		else {
			ans.push_back("NO");
		}
	}

	for (unsigned int i = 0; i < ans.size(); i++) {
		std::cout << ans[i] << std::endl;
	}

}