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++: #include <iostream>
#include <cmath>

using namespace std;
typedef pair<double, double> P;

double helon(P p1, P p2, P p3)
{
	double a = sqrt((p1.first - p2.first) * (p1.first - p2.first) + (p1.second - p2.second) * (p1.second - p2.second));
	double b = sqrt((p2.first - p3.first) * (p2.first - p3.first) + (p2.second - p3.second) * (p2.second - p3.second));
	double c = sqrt((p3.first - p1.first) * (p3.first - p1.first) + (p3.second - p1.second) * (p3.second - p1.second));
	double s = (a + b + c) / 2;
	return(sqrt(s * (s - a) * (s - b) * (s - c)));
}

void solve()
{
	P p[3];
	P xp;
	while(cin >> p[0].first >> p[0].second >> p[1].first >> p[1].second >> p[2].first >> p[2].second >> xp.first >> xp.second)
	{
		double square1 = helon(p[0], p[1], p[2]);
		double square2 = helon(p[0], p[1], xp);
		double square3 = helon(p[0], p[2], xp);
		double square4 = helon(p[1], p[2], xp);
		if(fabs(square1 - square2 - square3 - square4) < 1e-8)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <cstdlib>
#include <queue>
#include <vector>
#include <set>
#include <stdio.h>
#include <cstdio>
#include <cmath>
#include <complex> 
using namespace std;
typedef complex<double> xy_t;
xy_t P[4];
double x,y;
double a,b,c;
int main() {
	int i=0;
while (cin >> x >> y) {
	P[i] = xy_t(x,y);
	i += 1;
	if (i == 4) {
	a =  ((P[0]-P[3]).real()*(P[1]-P[3]).imag()-(P[0]-P[3]).imag()*(P[1]-P[3]).real())/2;
	b =  ((P[1]-P[3]).real()*(P[2]-P[3]).imag()-(P[1]-P[3]).imag()*(P[2]-P[3]).real())/2;
	c =  ((P[2]-P[3]).real()*(P[0]-P[3]).imag()-(P[2]-P[3]).imag()*(P[0]-P[3]).real())/2;
	bool p = a*b > 0 && b*c > 0;
cout << (p ? "YES" : "NO") << endl;
i = 0;
}
}
}

C++: #include <bits/stdc++.h>
using namespace std;

using ld = long double;
const ld eps = 1e-8, pi = acos(-1.0);

bool eq(ld a, ld b) {
	return abs(a - b) < eps;
}

using Point = complex<ld>;
class Line {
public:
	Point a, b;
};
ld dot(Point a, Point b) {
	return real(conj(a) * b);
}

ld cross(Point a, Point b) {
	return imag(conj(a) * b);
}

int ccw(Point a, Point b, Point c) {
	b -= a, c -= a;
	if (cross(b, c) > eps) return 1;	// a,b,c??????????¨???¨???
	if (cross(b, c) < -eps) return -1;	// a,b,c???????¨???????
	if (dot(b, c) < 0) return 2;		// c,a,b????????§??´???
	if (norm(b) < norm(c)) return -2;	// a,b,c???????????´???
	return 0;							// a,c,b???????????´???
}


int main()
{
	ld x1, x2, x3, xp, y1, y2, y3, yp;
	Point p1, p2, p3, P;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		p1 = Point(x1, y1);
		p2 = Point(x2, y2);
		p3 = Point(x3, y3);
		if (ccw(p1, p2, p3) == -1) {
			swap(p2, p3);
		}
		P = Point(xp, yp);
		cout << (ccw(p1, p2, P) == 1 && ccw(p2, p3, P) == 1 && ccw(p3, p1, P) == 1 ? "YES" : "NO") << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
#define EPS (1e-10)
#define equal(a,b) (fabs((a)-(b)) < EPS)

class Point{
public:
  double x,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 * (double a){
    return Point( a*x , a*y );
  }

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

  bool operator < (const Point &p)const{
    return x != p.x ? x < p.x : y < p.y;
  }

  bool operator == (const Point &p)const{
    return equal( x,p.x )&& equal( y,p.y );
  }
};

typedef Point Vector;

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

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

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;

int ccw( Point p0 , Point p1 , Point p2 ){
  Vector a = p1 - p0;
  Vector b = p2 - p0;
  if( cross(a,b) > EPS ) return COUNTER_CLOCKWISE;
  if( cross(a,b) < -EPS ) return CLOCKWISE;
  if( dot(a,b) < -EPS ) return ONLINE_BACK;
  if( a.norm() < b.norm() ) return ONLINE_FRONT;
  return ON_SEGMENT;
}

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

  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    int a = ccw(Point(x1,y1),Point(x2,y2),Point(xp,yp));
    int b = ccw(Point(x2,y2),Point(x3,y3),Point(xp,yp));
    int c = ccw(Point(x3,y3),Point(x1,y1),Point(xp,yp));

    if(a == b && b == c) cout << "YES" << endl;
    else cout << "NO" << endl;
  }  

  return 0;
}

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) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  double x[2],y[2],z[2],p[2];
  while(cin >>x[0]>>x[1]>>y[0]>>y[1]>>z[0]>>z[1]>>p[0]>>p[1]){
    double v[3][2],vp[3][2];
    v[0][0] = y[0]-x[0];
    v[0][1] = y[1]-x[1];
    v[1][0] = z[0]-y[0];
    v[1][1] = z[1]-y[1];
    v[2][0] = x[0]-z[0];
    v[2][1] = x[1]-z[1];
    vp[0][0] = p[0]-x[0];
    vp[0][1] = p[1]-x[1];
    vp[1][0] = p[0]-y[0];
    vp[1][1] = p[1]-y[1];
    vp[2][0] = p[0]-z[0];
    vp[2][1] = p[1]-z[1];
    bool f = true;
    for(int i=0; i<3; i++){
      if(v[i][0]*vp[i][1]-v[i][1]*vp[i][0]<0){
	f = false;
      }
    }
    if(f) cout <<"YES"<<endl;
    else cout <<"NO"<<endl;
  }
  return 0;
}

C++: #include<stdio.h>

double area(double x1, double y1, double x2, double y2, double x3, double y3)
{
    return(.5*(x1*(y2-y3)+x2*(y3-y2)+x3*(y1-y2)));
}

int main()
{
    double x1,y1,x2,y2,x3,y3,x4,y4,abc,aob,aoc,boc,abc2;
    while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4)==8)
    {
        abc=area(x1,y1,x2,y2,x3,y3);
        aob=area(x1,y1,x4,y4,x2,y2);
        aoc=area(x1,y1,x4,y4,x3,y3);
        boc=area(x2,y2,x4,y4,x3,y3);
        abc2=aob+aoc+boc;
        if(abc>abc2)
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}