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>
#include<cstdio>
#include<cmath>

using namespace std;

int main(){
  double x1,x2,x3,xp,y1,y2,y3,yp;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    double A = sqrt(pow(x1-x2,2)+pow(y1-y2,2)),B = sqrt(pow(x2-x3,2)+pow(y2-y3,2)), C = sqrt(pow(x1-x3,2)+pow(y1-y3,2)) ;
    double s = (A+B+C)/2.0;
    double S = sqrt(s*(s-A)*(s-B)*(s-C));
 
   double A12 = sqrt(pow(x1-x2,2)+pow(y1-y2,2)),B1p =sqrt(pow(x1-xp,2)+pow(y1-yp,2)), C2p = sqrt(pow(xp-x2,2)+pow(yp-y2,2)) ;
    double s2 = (A12+B1p+C2p)/2.0;
    double S2 = sqrt(s2*(s2-A12)*(s2-B1p)*(s2-C2p));
    if(S2 == 0){
      cout << "NO" << endl;
      break;
    }
    double A13 = sqrt(pow(x1-x3,2)+pow(y1-y3,2)), Cp3 = sqrt(pow(xp-x3,2)+pow(yp-y3,2));
    double s3 = (A13+B1p+Cp3)/2.0;
    double S3 =  sqrt(s3*(s3-A13)*(s3-B1p)*(s3-Cp3));
    if(s3 == 0){
      cout << "NO" << endl;
      break;
    }

    double A23 = sqrt(pow(x3-x2,2)+pow(y3-y2,2));
    double s4 = (A23+C2p+Cp3)/2.0;
    double S4 =  sqrt(s4*(s4-A23)*(s4-C2p)*(s4-Cp3));
    if(S3 == 0){
      cout << "NO" << endl;
      break;
    }
    double Ssum = S2+S3+S4;
    
    fabs(Ssum - S)<0.000001?cout << "YES" << endl:cout << "NO" << endl;


  }
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cmath>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;

double smen(double x1, double y1, double x2, double y2, double x3, double y3){
	return abs((x3-x2) * (y1-y2) - (x1-x2)*(y3-y2) )* 0.5;
	
}

int main(void){

double x1,y1,x2,y2,x3,y3,xp,yp;

	while(cin >> x1 ){
		cin >> y1 >> x2 >> y2 >> x3 >> y3;
		cin >> xp >> yp;
			
		double saa = smen(x1,y1,x2,y2,x3,y3);
		double sa1 = smen(x1,y1,x2,y2,xp,yp);
		double sa2 = smen(x1,y1,xp,yp,x3,y3);
		double sa3 = smen(xp,yp,x2,y2,x3,y3);
		
		if(saa == sa1 + sa2 + sa3) cout << "YES" <<endl;
		else  cout << "NO" << endl;
	}
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  double x[2],y[2],z[2],p[2];
  while(cin >>x[0]>>x[1]>>y[0]>>y[1]>>z[0]>>z[1]>>p[0]>>p[1]){
    double v[3][2],vp[3][2];
    v[0][0] = y[0]-x[0];
    v[0][1] = y[1]-x[1];
    v[1][0] = z[0]-y[0];
    v[1][1] = z[1]-y[1];
    v[2][0] = x[0]-z[0];
    v[2][1] = x[1]-z[1];
    vp[0][0] = p[0]-x[0];
    vp[0][1] = p[1]-x[1];
    vp[1][0] = p[0]-y[0];
    vp[1][1] = p[1]-y[1];
    vp[2][0] = p[0]-z[0];
    vp[2][1] = p[1]-z[1];
    bool f = true;
    for(int i=0; i<3; i++) if(v[i][0]*vp[i][1]-v[i][1]*vp[i][0]<=0) f = false;
    if(f) 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<iostream>
#include<cmath>
using namespace std;
double S(double ax,double ay,double bx,double by,double cx,double cy){
    double ab,bc,ca;
    ab=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
    bc=sqrt((bx-cx)*(bx-cx)+(by-cy)*(by-cy));
    ca=sqrt((cx-ax)*(cx-ax)+(cy-ay)*(cy-ay));
    double s=(ab+bc+ca)/2;
    double S=sqrt(s*(s-ab)*(s-bc)*(s-ca));
    return S;
}
int main(){
    double ax,ay,bx,by,cx,cy,px,py;
    while(cin>>ax>>ay>>bx>>by>>cx>>cy>>px>>py){
        double ABC,ABP,BCP,CAP;
        ABC=S(ax,ay,bx,by,cx,cy);
        ABP=S(ax,ay,bx,by,px,py);
        BCP=S(bx,by,cx,cy,px,py);
        CAP=S(cx,cy,ax,ay,px,py);
        double dif=ABC-ABP-BCP-CAP;
        if(dif<=0.001&&dif>=-0.001)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;
        double X1 = x[0], X2 = x[1], X3 = x[2];
        double Y1 = y[0], Y2 = y[1], Y3 = y[2];

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

        cout << (ans%3==0?"YES":"NO") << endl;
    }
}

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

struct coordinates{
	double x;
	double y;
};
typedef struct coordinates coordinates_t;

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


int main()
{
	
	coordinates_t A,B,C,P;
	while(cin >>A.x>>A.y>>B.x>>B.y>>C.x>>C.y>>P.x>>P.y){
		
		coordinates_t AB = sub_vector(B, A);
		coordinates_t BP = sub_vector(P, B);
		
		coordinates_t BC = sub_vector(C, B);
		coordinates_t CP = sub_vector(P, C);
		
		coordinates_t CA = sub_vector(A, C);
		coordinates_t AP = sub_vector(P, A);
		
		// 外積
		double c1 = AB.x*BP.y - AB.y*BP.x;
		double c2 = BC.x*CP.y - BC.y*CP.x;
		double c3 = CA.x*AP.y - CA.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;
}