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 <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);
        cout << Tarea << " " << Carea << endl;
        if(fabs(Tarea-Carea)<=0.0000000000001) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main() {
  float x1, y1, x2, y2, x3, y3, xp, yp;
  while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
    float a_x = x2 - x1, a_y = y2 - y1;
    float b_x = x3 - x1, b_y = y3 - y1;
    float c_x = xp - x1, c_y = yp - y1;
    float det = a_x * b_y - a_y * b_x;
    float s = (b_y * c_x - b_x * c_y) / det, t = (-a_y * c_x + a_x * c_y) / det;
    cout << ((0 <= s && s <= 1 && 0 <= t && t <= 1 && s + t <= 1) ? "YES" : "NO") << endl;
  }
}

C++: #include<cstdio>
using namespace std;
int main(){
	double a[8],matrix[4],ans[2];
	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7]) != EOF){
		matrix[0] = a[2]-a[0];
		matrix[1] = a[4]-a[0];
		matrix[2] = a[3]-a[1];
		matrix[3] = a[5]-a[1];
		ans[0] = a[6]-a[0];
		ans[1] = a[7]-a[1];
		double t = matrix[0]*matrix[3]-matrix[1]*matrix[2];
		double x = matrix[3]*ans[0]/t-matrix[1]*ans[1]/t;
		double y = matrix[0]*ans[1]/t-matrix[2]*ans[0]/t;
		if(x+y<1 && x>0 && y>0){printf("YES\n");}
		else{printf("NO\n");}
	}
	return 0;
}

C++: #include <stdio.h>
#include <math.h>

using namespace std;

//I can't understand, so I search the solution at http://oshiete.goo.ne.jp/qa/5729013.html

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

	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
		count=0;
		calc1 = (x1-xp)*(x2-xp)+(y1-yp)*(y2-yp);
		if(calc1 < 0)count++;
		calc2 = (x1-xp)*(x3-xp)+(y1-yp)*(y3-yp);
		if(calc2 < 0)count++;
		calc3 = (x3-xp)*(x2-xp)+(y3-yp)*(y2-yp);
		if(calc3 < 0)count++;

		if(count >= 2)printf("YES\n");
		else{
			printf("NO\n");
		}
	}
    return 0;
}

C++: #include <stdio.h>
#include <math.h>
 
using namespace std;
 
int main(){
    double x1,x2,x3,y1,y2,y3,xp,yp;
    double calc1,calc2,calc3;
 
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
        calc1 = (x2-x1)*(yp-y1)-(y2-y1)*(xp-x1);
        calc2 = (x3-x2)*(yp-y2)-(y3-y2)*(xp-x2);
        calc3 = (x1-x3)*(yp-y3)-(y1-y3)*(xp-x3);
 
        if((calc1>0&&calc2>0&&calc3>0) || (calc1<0&&calc2<0&&calc3<0)){
            printf("YES\n");
        }else{
            printf("NO\n");
        }
    }
    return 0;
}

C++: #include<stdio.h>
int main(){
    double x1,x2,x3,x4,y1,y2,y3,y4;
    while(~scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4)){
        bool ok1=true;
        bool ok2=true;
        if((x2-x1)*(y4-y1)-(x4-x1)*(y2-y1)<0)ok1=false;
        else ok2=false;
        if((x3-x2)*(y4-y2)-(x4-x2)*(y3-y2)<0)ok1=false;
        else ok2=false;
        if((x1-x3)*(y4-y3)-(x4-x3)*(y1-y3)<0)ok1=false;
        else ok2=false;
        printf((ok1||ok2)?"YES\n":"NO\n");
    }
}

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

double helon(double x1,double y1,double x2,double y2,double x3,double y3){
	double a,b,c,s,area;
	a = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
	b = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
	c = sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
	s = (a+b+c)/2;
	area = sqrt(s*(s-a)*(s-b)*(s-c));
	return area;
}

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		double s,s1,s2,s3;
		s = helon(x1,y1,x2,y2,x3,y3);
		s1 = helon(xp,yp,x1,y1,x2,y2);
		s2 = helon(xp,yp,x2,y2,x3,y3);
		s3 = helon(xp,yp,x3,y3,x1,y1);
		if(s == s1+s2+s3) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

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

using namespace std;

inline double sq (double x) {
    return x * x;
}

double rad (double x1, double y1, double x2, double y2) {
    return acos((x1 * x2 + y1 + y2) /
        (sqrt(sq(x1) + sq(y1)) * sqrt(sq(x2) + sq(y2))));
}

int main (void) {
    double x1, x2, x3, xp;
    double y1, y2, y3, yp;
    for (;;) {
        cin >> x1; cin >> y1;
        cin >> x2; cin >> y2;
        cin >> x3; cin >> y3;
        cin >> xp; cin >> yp;
        if (cin.eof()) break;
        double d1, d2, d3;
        d1 = rad(x1 - xp, y1 - yp, x2 - xp, y2 - yp);
        d2 = rad(x1 - xp, y1 - yp, x3 - xp, y3 - yp);
        d3 = rad(x2 - xp, y2 - yp, x3 - xp, y3 - yp);
        if (d1 + d2 + d3 < 2 * M_PI)
            cout << "NO" << endl;
        else
            cout << "YES" << endl;
    }
    return 0;
}

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

double f(double x1, double y1, double x2, double y2, double xp, double yp) {
    return (y2 - y1) * xp + (-x2 + x1) * yp - x1 * (y2 - y1) + y1 * (x2 - x1);
}


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

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    double x1, y1, x2, y2, x3, y3, xp, yp;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
        x2-=x1;
        x3-=x1;
        xp-=x1;
        y2-=y1;
        y3-=y1;
        yp-=y1;
        double m=(x3*y2-x2*y3);
        double p=(x3*yp-xp*y3)/m;
        double q=(xp*y2-x2*yp)/m;
        cout<<((p>=0&&q>=0&&p+q<=1)?"YES\n":"NO\n");
    }
    return 0;
}