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<complex>
using namespace std;

typedef complex<double> P;
#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) <EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

double cross(P a, P b) {
	  return (a.real() * b.imag() - a.imag() * b.real());
}

// a1,a2ツづーツ端ツ点ツづつキツづゥツ静シツ閉ェツづ1,b2ツづーツ端ツ点ツづつキツづゥツ静シツ閉ェツづ個古ーツ債キツ板サツ津ィ
int is_intersected_ls(P a1, P a2, P b1, P b2) {
	  return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
		           ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
}

int main(void){
	P A,B,C,P;
	
	while(cin>>A.real()>>A.imag()>>B.real()>>B.imag()>>C.real()>>C.imag()>>P.real()>>P.imag()){
		if(is_intersected_ls(A,P,B,C)){
			cout<<"NO"<<endl;
			continue;
		}
		if(is_intersected_ls(B,P,A,C)){
			cout<<"NO"<<endl;
			continue;
		}
		if(is_intersected_ls(C,P,A,B)){
			cout<<"NO"<<endl;
			continue;
		}
		cout<<"Yes"<<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 , 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 <iostream>
using namespace std;

int main() {
    float x1, x2, x3, y1, y2, y3, xp, yp;
    float a, b, c;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp) {
        a = (x3 - x2) * (yp - y2) - (y3 - y2) * (xp - x2);
        b = (x1 - x3) * (yp - y3) - (y1 - y3) * (xp - x3);
        c = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1);
        
        if((a>=0 && b>=0 && c>=0) || (a<=0 && b<=0 && c<= 0)) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

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

double x[4],y[4];
string judge ();

int main() {
	while ( cin >> x[0] ) {
		for( int i = 0; i < 4; i++ ){
			if ( !i )
				cin >> y[i];
			else
				cin >> x[i] >> y[i];
		}
		
		cout <<  judge () << endl;
		
	}
	return 0;
}

string judge () {
	string res;
	double a,b;
	int n,nn;
	
	for ( int i = 0; i < 3; i++ ) {
		if ( i == 2 ){
			n = '0';
			nn = n + 1;
		}else if ( i == 1 ){
			n = i + 1;
			nn = '0';
		}else{
			n = i + 1;
			nn = n + 1;
		}
		
		if ( x[n] != x[i] ){
			a = (y[n] - y[i]) / (x[n] - x[i]);
			b = (x[i] * y[n] - x[n] * y[i]) / (x[i] - x[n]);
			
			if ( (a * x[3] + b) > y[3] && (a * x[nn] + b) < y[nn] || (a * x[3] + b) < y[3] && (a * x[nn] + b) > y[nn] ) {
				return "NO";
			}
		} else {
			
			if ( x[3] < x[i] && x[nn] > x[i] || x[3] > x[i] && x[nn] < x[i] )
				return "NO";
		}
		
	}
	return "YES";
	
}

C++: #include<iostream>
using namespace std;
int main()
{
double x;
double x1,y1,x2,y2,x3,y3,xp,yp;
int S=0;
while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
{
	if(y1<y2&&y3<y2)
	{
	for(double i=x1;i<=x3;i+=0.0001)
{
x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)>(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)>(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)<(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
	S++;
cout<<"YES"<<endl;
break;	
}
}
}
else if(y1>y2&&y1>y1)
{
for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)>(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)<(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)>(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
	S++;
cout<<"YES"<<endl;
break;	
	}	
	}	
}
else if(y3>y1&&y3>y2)
{
	for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)<(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)>(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)>(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
	S++;
cout<<"YES"<<endl;
break;
}
}
}

{
if(S<1)
{
 	cout<<"NO"<<endl;
 }
}
}
return 0;
}

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

double area(double x1,double y1,double x2,double y2,double x3,double y3)
{
   return abs((x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))/2.0);
}
bool res(double x1,double y1,double x2,double y2,double x3,double y3,double x,double y)
{
   double A = area (x1, y1, x2, y2, x3, y3);
   double A1 = area (x, y, x2, y2, x3, y3);
   double A2 = area (x1, y1, x, y, x3, y3);
   double A3 = area (x1, y1, x2, y2, x, y);
   return (A == A1 + A2 + A3);
}

int main()
{
   double x1,x2,x3,y1,y2,y3,x,y;
   while (scanf ("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&x,&y)==8)
   {
      if (res(x1,y1,x2,y2,x3,y3,x,y))
     printf ("YES\n");
   else
     printf ("NO\n");
   }
   return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
  double x1,y1,x2,y2,x3,y3,px,py,s1,s2,s3,s;
  while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>px>>py){
  s1=(fabs((x2-px)*(y3-py)-(y2-py)*(x3-px)))/2;
  s2=(fabs((px-x1)*(y3-y1)-(py-y1)*(x3-x1)))/2;
  s3=(fabs((x2-x1)*(py-y1)-(y2-y1)*(px-x1)))/2;
  s=(fabs((x2-x1)*(y3-y1)-(y2-y1)*(x3-x1)))/2;
  if(s1==0||s2==0||s3==0)cout<<"NO"<<endl;
  else{
    if((s1+s2+s3)==s)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
  }
  return 0;
}

C++: // 2014/02/08 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		double x1, y1, x2, y2, x3, y3, xp, yp;
		cin >> x1;
		if(cin.eof())
			break;
		cin >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;

		double c1 = (x2-x1)*(yp-y2)-(y2-y1)*(xp-x2);
		double c2 = (x3-x2)*(yp-y3)-(y3-y2)*(xp-x3);
		double c3 = (x1-x3)*(yp-y1)-(y1-y3)*(xp-x1);

		if((c1>0.0 && c2>0.0 && c3>0.0) || (c1<0.0 && c2<0.0 && c3<0.0)){
			cout << "YES" << endl;
		}
		else{
			cout << "NO" << endl;
		}
	}

	return 0;
}