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<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  float x1,y1,x2,y2,x3,y3,xp,yp;
  float a,b,c,d,e,f,s1,s2,t1,t2;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    t2 = 0;
    a = sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
    b = sqrt((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1));
    c = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
    s1 = (a+b+c)/2.0; // 3辺を頂点とする三角形の面積
    t1 = sqrt(s1*(s1-a)*(s1-b)*(s1-c));
    d = sqrt((xp-x1)*(xp-x1)+(yp-y1)*(yp-y1));
    e = sqrt((x3-xp)*(x3-xp)+(y3-yp)*(y3-yp));
    f = sqrt((x2-xp)*(x2-xp)+(y2-yp)*(y2-yp));
    s2 = (a+e+f)/2; 
    t2 += sqrt(s2*(s2-a)*(s2-e)*(s2-f));
    s2 = (b+d+e)/2; 
    t2 += sqrt(s2*(s2-b)*(s2-d)*(s2-e));
    s2 = (c+d+f)/2; 
    t2 += sqrt(s2*(s2-c)*(s2-d)*(s2-f));
    if( t1 >= t2){
      cout << "YES" << endl;
    }else {
      cout << "NO" << endl;
    }
  }
}

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

bool is_up (double x1, double y1, double x2, double y2, double px, double py) {
    if (x1 == x2) return px > x1;
    return (py > (y2 - y1) / (x2 - x1) * px + (x1 * y2 - x2 * y1) / (x1 - x2) );
}

int main() {
    double x1,y1,x2,y2,x3,y3,xp,yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        int up = 0;
        up += is_up(x1, y1, x2, y2, xp, yp);
        up += is_up(x3, y3, x2, y2, xp, yp);
        up += is_up(x1, y1, x3, y3, xp, yp);

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

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

struct Vector{
	double x;
	double y;
};

Vector sub_vector(Vector &a , Vector &b){
	Vector ret;
	ret.x=a.x-b.x;
	ret.y=a.y-b.y;
	return ret;
}

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	Vector v[4];
	while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
		v[0].x=x1; //a
		v[0].y=y1;
		v[1].x=x2; //b
		v[1].y=y2;
		v[2].x=x3; //c
		v[2].y=y3;
		v[3].x=xp; //p
		v[3].y=yp;
		Vector ba = sub_vector(v[0] , v[1]);
		Vector bp = sub_vector(v[3] , v[1]);
		Vector cb = sub_vector(v[1] , v[2]);
		Vector cp = sub_vector(v[3] , v[2]);
		Vector ac = sub_vector(v[2] , v[0]);
		Vector ap = sub_vector(v[3] , v[0]);
		double c1 = ba.x * bp.y - ba.y * bp.x; //??????
		double c2 = cb.x * cp.y - cb.y * cp.x;
		double c3 = ac.x * ap.y - ac.y * ap.x;
		if((c1<0 && c2<0 && c3 <0)||(c1>=0 && c2>=0 && c3>=0)) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
		
	}
	return 0;
}

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

int main(void){

	double x1,x2,x3,xp,y1,y2,y3,yp,l12,l23,l13,l1p,l2p,l3p,S123,S12p,S23p,S13p;

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

		l12=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		l23=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
		l13=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
		l1p=sqrt((x1-xp)*(x1-xp)+(y1-yp)*(y1-yp));
		l2p=sqrt((x2-xp)*(x2-xp)+(y2-yp)*(y2-yp));
		l3p=sqrt((x3-xp)*(x3-xp)+(y3-yp)*(y3-yp));
		S123=(sqrt((l12+l23+l13)*(-l12+l23+l13)*(l12-l23+l13)*(l12+l23-l13)))/4;
		S12p=(sqrt((l12+l2p+l1p)*(-l12+l2p+l1p)*(l12-l2p+l1p)*(l12+l2p-l1p)))/4;
		S13p=(sqrt((l1p+l3p+l13)*(-l1p+l3p+l13)*(l1p-l3p+l13)*(l1p+l3p-l13)))/4;
		S23p=(sqrt((l2p+l23+l3p)*(-l2p+l23+l3p)*(l2p-l23+l3p)*(l2p+l23-l3p)))/4;
		if(fabs(S123-(S12p+S13p+S23p))<0.1){
			puts("YES");
		}
		else{
			puts("NO");
		}
	}

	return 0;
}

C++: #include<iostream>

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while (std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		double ax, ay, bx, by, s, t;
		ax = x2 - x1; ay = y2 - y1;
		bx = x3 - x1; by = y3 - y1;
		// sa + tb = p - ra
		// sax + tbx = xp - x1
		// say + tby = yp - y1
		s = (yp - y1 - ((xp - x1) / bx)) / (ay - (ax / bx));
		t = (xp - x1 - (s * ax)) / bx;
		if (s > 0 && t > 0 && s + t < 1) std::cout << "YES" << std::endl;
		else std::cout << "NO" << std::endl;
	}
	return 0;
}

C++: 
#include <iostream>
#include <vector>
#include <cmath>
#include <cassert>
#include <complex>
#include <algorithm>
#define rep(i,n) for(int i = 0;i < n;i++)
using namespace std;

typedef complex<double> P;
const double EPS = 1e-8;
const double INF = 1e6;

double cross(P a,P b){
    return imag(conj(a)*b);
}


int main(){
    double x1, y1, x2, y2, x3, y3, xp, yp;
    while(cin >>x1>> y1>> x2>> y2>> x3>> y3>> xp>> yp){
        P v1=P(x1,y1),v2=P(x2,y2),v3=P(x3,y3),vp=P(xp,yp);
        if((cross(vp-v1,vp-v2)>0)&&(cross(vp-v2,vp-v3)>0)&&(cross(vp-v3,vp-v1)>0)){
            cout << "YES"<<endl;
        }else if((cross(vp-v1,vp-v2)<0)&&(cross(vp-v2,vp-v3)<0)&&(cross(vp-v3,vp-v1)<0)){
            cout << "YES"<<endl;
        }else{
            cout << "NO"<<endl;
        }

    }
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
#include<cstdlib>
using namespace std;
struct axis
{
    double x,y;

};
double area(axis a,axis b,axis c)
{
    double are=(a.x* (b.y-c.y)-a.y*(b.x-c.x)+(b.x * c.y- c.x * b.y))/2;
    return abs(are);
}
int main()
{
    axis a,b,c,x;
    while(cin>>a.x>>a.y>>b.x>>b.y>>c.x>>c.y>>x.x>>x.y)
    {

        double areatot=area(a,b,c),areaa=area(a,b,x),areab=area(b,c,x),areac=area(c,a,x);
        if(areatot==(areaa+areab+areac))
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;


    }


    return 0;
}