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 <bits/stdc++.h>
using namespace std;

#define FOR(i,l,r) for(int i = (l);i < (r);i++)
#define ALL(x) (x).begin(),(x).end()
template<typename T> bool chmax(T& a,const T& b){return a < b ? (a = b,true) : false;}
template<typename T> bool chmin(T& a,const T& b){return b < a ? (a = b,true) : false;}
typedef long long ll;

int main()
{
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(~scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)){
		double a = (x2 - x1) * (yp - y1) - (xp - x1) * (y2 - y1);
		double b = (x3 - x2) * (yp - y2) - (xp - x2) * (y3 - y2);
		double c = (x1 - x3) * (yp - y3) - (xp - x3) * (y1 - y3);
		if(a > 0 && b > 0 && c > 0){
			printf("YES\n");
		}
		else{
			printf("NO\n");
		}
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.00001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

double area(double ax, double ay, double bx, double by, double cx, double cy)
{
  double sum;
  double len1,len2,len3;

  len1=sqrt( (ax-bx)*(ax-bx) + (ay-by)*(ay-by) );
  len2=sqrt( (ax-cx)*(ax-cx) + (ay-cy)*(ay-cy) );
  len3=sqrt( (bx-cx)*(bx-cx) + (by-cy)*(by-cy) );

  double s=(len1+len2+len3)/2;

  sum=sqrt(s*(s-len1)*(s-len2)*(s-len3));

  return sum;
}


int main()
{
  double x1,x2,x3,y1,y2,y3,px,py;
  double s1,s2,s3,s4;

  while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",
	      &x1,&y1,&x2,&y2,&x3,&y3,&px,&py)!=EOF){

    s1=area(x1,y1,x2,y2,px,py);
    s2=area(x1,y1,x3,y3,px,py);
    s3=area(x2,y2,x3,y3,px,py);
    s4=area(x1,y1,x2,y2,x3,y3);

    if(s1+s2+s3-s4<EPS)
      cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;

  }
}

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

float S(float a, float b, float c, float d, float e, float f) {
	float ans;
	ans = abs((a - e) * (d - f) - (b - f) * (c - e));
	return ans/2;
}

int main(){
	float x[4], y[4], s[3], SS, SSS;

	while(true){
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];
		if (cin.eof()) { break; }
		s[0] = S(x[0], y[0], x[1], y[1], x[3], y[3]);
		s[1] = S(x[0], y[0], x[2], y[2], x[3], y[3]);
		s[2] = S(x[1], y[1], x[2], y[2], x[3], y[3]);
		if(s[0] * s[1] * s[2] == 0){ 
			cout << "NO" << endl;
			continue;
		}
		SS = s[0] + s[1] + s[2];
		SSS = S(x[0], y[0], x[1], y[1], x[2], y[2]);

		if (SS == SSS) { cout << "YES" << endl; }
		else { cout << "NO" << endl; }
	}
	return 0;
}

C++: struct Vec2 {
  double x, y;
  Vec2(double x_, double y_) : x(x_), y(y_) {}
};

bool in_the_triangle(const Vec2& a, const Vec2& b, const Vec2& c, const Vec2& p) {
  Vec2 aa(a.x-p.x, a.y-p.y);
  Vec2 bb(b.x-p.x, b.y-p.y);
  Vec2 cc(c.x-p.x, c.y-p.y);
  double k = aa.x*bb.y - bb.x*aa.y;
  double l = bb.x*cc.y - cc.x*bb.y;
  double m = cc.x*aa.y - aa.x*cc.y;
  return (k * l > 0 && k * m > 0);
}

int main() {
Vec2 a,b,c,p;
while (scanf("%f%f%f%f%f%f%f%f",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y,&p.x,&p.y)) {
  puts(in_the_triangle(a,b,c,p) ? "YES" : "NO");
}
return 0;
}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 
 using namespace std;
 
 //int v[35];
 
 double triangleArea(double xa,double ya,double xb,double yb,double xc,double yc) 
 {
    double result = ((xa * yb + xb * yc + xc * ya- xb * ya - xc * yb - xa * yc) / 2.0);
    if(result<0) result=-result;
    return result;
 }
 
 int main()
 {
   double x1,y1,x2,y2,x3,y3,xp,yp;
   while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
   {
     double triangleAreaKK = triangleArea(x1,y1, x2,y2, x3,y3);
     double area = triangleArea(xp,yp, x1,y1, x2,y2);
     area += triangleArea(xp,yp, x1,y1, x3,y3);
     area += triangleArea(xp,yp, x2,y2, x3,y3);
     if(((triangleAreaKK-area)<0.00000001)&&((triangleAreaKK-area)>-0.00000001)) puts("YES");
     else puts("NO");     
   }
   //while(1);      
   return 0;    
 }