Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

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

bool isin(double a, double b, double c){
	if(a>b) swap(a,b);
	if(b-a<M_PI){
		return (a<c && c<b);
	}
	else{
		return (b<c || c<a);
	}
}

int main(void){

	while(true){

	if(cin.eof()) break;

	complex<double> p[4];
	double a, b, c, d, e, f, g, h;
	cin >> a >> b >> c >> d >> e >> f >> g >> h;
	p[0] = complex<double>(a,b);
	p[1] = complex<double>(c,d);
	p[2] = complex<double>(e,f);
	p[3] = complex<double>(g,h);

	double arg1, arg2, arg3;
	arg1 = arg(p[1]-p[0]);
	arg2 = arg(p[2]-p[0]);
	arg3 = arg(p[3]-p[0]);

	if(arg1<0) arg1+=2*M_PI;
	if(arg2<0) arg2+=2*M_PI;
	if(arg3<0) arg3+=2*M_PI;

	bool b0;
	b0 = isin(arg1, arg2, arg3);

	/////////////////////////

	arg1 = arg(p[0]-p[1]);
	arg2 = arg(p[2]-p[1]);
	arg3 = arg(p[3]-p[1]);

	if(arg1<0) arg1+=2*M_PI;
	if(arg2<0) arg2+=2*M_PI;
	if(arg3<0) arg3+=2*M_PI;

	bool b1;
	b1 = isin(arg1, arg2, arg3);

	/////////////////////////

	arg1 = arg(p[0]-p[2]);
	arg2 = arg(p[1]-p[2]);
	arg3 = arg(p[3]-p[2]);

	if(arg1<0) arg1+=2*M_PI;
	if(arg2<0) arg2+=2*M_PI;
	if(arg3<0) arg3+=2*M_PI;

	bool b2;
	b2 = isin(arg1, arg2, arg3);

	/////////////////////////

	if( b0 && b1 && b2 ) cout << "YES" << endl;
	else cout << "NO" << endl;

	}

	return 0;
}

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

using namespace std;

inline double out(double ax,double ay,double bx,double by){
	return bx * ay - by * ax;
}

int main(void){
	double x1, y1, x2, y2, x3, y3, px, py;
	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&px,&py) != EOF){
		if((out(px - x1,py - y1,x2 - x1,y2 - y1) > 0 && out(px - x2,py - y2,x3 - x2,y3 - y2) > 0 && out(px - x3,py - y3,x1 - x3,y1 - y3) > 0) && (out(px - x1,py - y1,x2 - x1,y2 - y1) < 0 && out(px - x2,py - y2,x3 - x2,y3 - y2) < 0 && out(px - x3,py - y3,x1 - x3,y1 - y3) < 0)){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}

	return 0;
}

C++: #include<iostream>
typedef float f;f a,b,c,d,h,i,e,g;int r(f k,f l,f m,f n){m-=k;n-=l;k=e-k;l=g-l;return m*l-n*k?m*l-n*k>0?1:-1:0;}int main(){for(;!(std::cin>>a>>b>>c>>d>>h>>i>>e>>g).eof();)std::cout<<(r(a,b,c,d)==r(c,d,h,i)==r(h,i,a,b)?"YES\n":"NO\n");}

C++: #include <stdio.h>
using namespace std;
int main(){
double px,py;
double tx[3],ty[3];
bool flag;
bool v[3];
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&tx[0],&ty[0],&tx[1],&ty[1],&tx[2],&ty[2],&px,&py) == 8){
for(int i=0;i<3;i++){
tx[i]=tx[i]-px;
ty[i]=ty[i]-py;
}
for(int i=0;i<3;i++){
if((tx[i%3]*ty[(i+1)%3])-(ty[i%3]*tx[(i+1)%3])<0){
v[i]=true;
}else{
v[i]=false;
}
}
if(v[0]!=v[1]){
cout<<"NO"<<endl;
}else if(v[1]!=v[2]){
cout<<"NO"<<endl;
}else {
cout<<"YES"<<endl;
}
}
return 0;
}

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

double area(complex<double> a, complex<double> b, complex<double> c){
  return (conj(b-a)*(c-a)).imag()/2.0;
}

int main(){
  double x1,y1,x2,y2,x3,y3,xp,yp;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    complex<double> v[3];
    complex<double> vp;

    v[0]=complex<double>(x1,y1);
    v[1]=complex<double>(x2,y2);
    v[2]=complex<double>(x3,y3);
    vp  =complex<double>(xp,yp);

    double s[3];
    for(int j=0;j<3;j++) 
      s[j]=area(vp,v[j],v[(j+1)%3]);

    if(s[0]*s[1]>0 && s[1]*s[2]>0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }

  return 0;
}

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

void fun(float a, float b, float c, float d, float e, float f)
{
    float u,v;
    v = (c*d-a*f)/(b*d-a*e);
    u = (c-b*v)/a;
    if (u>0 && v>0 && (u+v) <=1)
        cout <<"YES"<< endl;
    else
        cout <<"NO"<< endl;
}

int main()
{
    float x1,y1,x2,y2,x3,y3,xp,yp;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
    {
        fun(x2-x1,x3-x1,xp-x1,y2-y1,y3-y1,yp-y1);
    }
   return 0;
}

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

typedef std::pair<float, float> point;
typedef std::pair<float, float> vec;

inline float cross_product(const vec& v1, const vec& v2) {
    return v1.first * v2.second - v1.second * v2.first;
}

inline vec vec_sub(const vec& v1, const vec& v2) {
    return std::make_pair(v1.first - v2.first, v1.second - v2.second);
}

int main() {    
    point p1, p2, p3, p4;
    while (scanf("%f %f %f %f %f %f %f %f",
                 &p1.first, &p1.second,
                 &p2.first, &p2.second,
                 &p3.first, &p3.second,
                 &p4.first, &p4.second) != EOF) {
        vec v12 = vec_sub(p1, p2);
        vec v24 = vec_sub(p2, p4);
        float cp1 = cross_product(v12, v24);
        
        vec v23 = vec_sub(p2, p3);
        vec v34 = vec_sub(p3, p4);
        float cp2 = cross_product(v23, v34);
        
        vec v31 = vec_sub(p3, p1);
        vec v14 = vec_sub(p1, p4);
        float cp3 = cross_product(v31, v14);
        
        int r = std::signbit(cp1);
        r += std::signbit(cp2);
        r += std::signbit(cp3);
        
        printf(r == 0 || r == 3 ? "YES\n" : "NO\n");
    }
}