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>
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;
}

C++: #include <iostream>

using namespace std;

int islineCross(double x1, double y1, double x2, double y2, double c1, double c2, double d1, double d2) {
  if (((c2-y1)*(x1-x2)-(c1-x1)*(y1-y2))*((d2-y1)*(x1-x2)-(d1-x1)*(y1-y2)) > 0)
    return -1;
  else
    return 0;
}

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

  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    int CrossCount = 0;
    if (islineCross(x1,y1,x2,y2,xp,yp,xp+100,yp) == 0)
      CrossCount++;
    if (islineCross(x2,y2,x3,y3,xp,yp,xp+100,yp) == 0)
      CrossCount++;
    if (islineCross(x1,y1,x3,y3,xp,yp,xp+100,yp) == 0)
      CrossCount++;
    
    if (CrossCount == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } 

  return 0;
}

C++: #include<iostream>
#include<math.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a),end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

double dist(double x1, double y1, double x2, double y2){
    return sqrt( ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) );
}

double triangleArea(double x, double y, double z){
    return (y * z * sin( acos( (y * y +  z * z - x * x) / (2 * y * z) ) )) / 2;
}

double inputXY(double x1, double y1, double x2, double y2, double x3, double y3){
    double x, y ,z;
    x = dist(x1, y1, x2, y2);
    y = dist(x2, y2, x3, y3);
    z = dist(x3, y3, x1, y1);
    return triangleArea(x, y, z);
}

int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    double allArea, area12, area23, area31;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
    allArea = inputXY(x1, y1, x2, y2, x3, y3);
    area12 = inputXY(xp, yp, x2, y2, x1, y1);
    area23 = inputXY(x2, y2, x3, y3, xp, yp);
    area31 = inputXY(x3, y3, x1, y1, xp, yp);

    if(abs(allArea - (area12 + area23 + area31)) < 0.00001) cout << "YES" << endl;
    else cout << "NO" << endl;

}

C++: #include <iostream>
#include <vector>

using namespace std;

int main(){
    double a, b, c, d, e, f;
    double p, q;
    while(cin >> a >> b >> c >> d >> e >> f){
        cin >> p >> q;
        vector<int> x(3), y(3);
        x[0] = a; x[1] = c; x[2] = e;
        y[0] = b; y[1] = d; y[2] = f;
        int ret = 0;
        bool is = false;
        for(int i=0; i < x.size(); i++){
            double X1 = x[i%3], X2 = x[(i+1)%3], X3 = x[(i+2)%3];
            double Y1 = y[i%3], Y2 = y[(i+1)%3], Y3 = y[(i+2)%3];
            int ans = 0;
            if ((X2-X1)*(q-Y1)-(Y2-Y1)*(p-X1)>0.0) ans++;
            if ((X3-X2)*(q-Y2)-(Y3-Y2)*(p-X2)>0.0) ans++;
            if ((X1-X3)*(q-Y3)-(Y1-Y3)*(p-X3)>0.0) ans++;
            if(ans%3==0) is = true;
        }
        cout << (is?"YES":"NO") << endl;
    }
}

C++: #include <iostream>
double x[3], y[3], xp, yp;
int main() {
	while (std::cin>>x[0]>>y[0]>>x[1]>>y[1]>>x[2]>>y[2]>>xp>>yp) {
		int bit = 3;
		for (int i=0; i<3; ++i) {
			double tmp = (x[(i+1)%3]-x[i])*(yp-y[i])-(y[(i+1)%3]-y[i])*(xp-x[i]);
			bit &= ~((tmp < 0) + 1);
		}
		std::cout << (bit ? "YES" : "NO") << "\n";
	}
}