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<algorithm>
using namespace std;
int main(){
	double x[3],y[3],px,py;
	while(cin>>x[0]>>y[0]){
		for(int i=1;i<3;i++)cin>>x[i]>>y[i];
		cin>>px>>py;
		bool ok=true;
		for(int i=0;i<3;i++){
			bool plus=false;
			if(x[(i+1)%3]==x[(i+2)%3]){
				if(x[i]>x[(i+1)%3])plus=true;
			}
			else{
				double a,b;
				a=(x[i]-x[(i+1)%3])*(y[(i+2)%3]-y[(i+1)%3]);
				b=(y[i]-y[(i+1)%3])*(x[(i+2)%3]-x[(i+1)%3]);
				if(a>b)plus=true;
			}
			bool pnt=false;
			if(x[(i+1)%3]==x[(i+2)%3]){
				if(px>x[(i+1)%3])pnt=true;
			}
			else{
				double a,b;
				a=(px-x[(i+1)%3])*(y[(i+2)%3]-y[(i+1)%3]);
				b=(py-y[(i+1)%3])*(x[(i+2)%3]-x[(i+1)%3]);
				if(a>b)pnt=true;
			}
			if(pnt!=plus)ok=false;
		}
		if(ok)cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.pt", "r", stdin);
	string str = "";

	while (getline (cin, str )){
		int i;
		vector <double> tpx (3, 0.);
		vector <double> tpy (3, 0.);
		double px = 0.;
		double py = 0.;
	
		stringstream ss(str);
		double minX = DBL_MAX; double maxX = DBL_MIN;
		double minY = DBL_MAX; double maxY = DBL_MIN;
		for (i = 0; i < 3; ++i){
			double tx,ty;
			ss >> tx >> ty;
			tpx[i] = tx; tpy[i] = ty;
			minX = min (minX, tx); maxX = max (maxX, tx);
			minY = min (minY, ty); maxY = max (maxY, ty);
		} // end for
		ss >> px >> py;

		if (px < minX || px > maxX || py < minY || py > maxY){
			cout << "NO" << endl;
			return 0;
		} // end if
		 
		vector <double> a(3, 0.);
		vector <double> b(3, 0.);
		vector <double> c(3, 0.);
/*
		for (i = 0; i < 3; ++i){
			cout << "tp[" << i << "]: ";
			cout << '(' << tpx[i] << ',' << tpy[i] << ')' << endl;
		} // end for
		cout << "p: ";
		cout << '(' << px << ',' << py << ')' << endl;
*/
		int j;
		for (i = 0; i < 3; ++i){
			j = (i + 1) % 3;
			if (tpx[i] == tpx[j]){
				a[i] = 1.0;
				b[i] = 0.0;
				c[i] = -a[i]*tpx[i] - b[i]*tpy[i];
			}else if (tpy[i] == tpy[j]){
				a[i] = 0.0;
				b[i] = 1.0;
				c[i] = -a[i]*tpx[i] - b[i]*tpy[i];
			}else{
				a[i] = (tpy[j] - tpy[i]);
				b[i] = -(tpx[j] - tpx[i]);
 				c[i] = -a[i]*tpx[i] - b[i]*tpy[i];
			} // end if
//			cout << a[i] << ' ' << b[i] << ' ' << c[i] << endl;
		} // end for
		vector <int> d(3, 0);

		for (i = 0; i < 3; ++i){
			if (a[i] != 0.0 && b[i] != 0.0){
				if ( py > (-a[i]*px - c[i])/b[i] ){
					d[i] = 1;
				}else if ( py < (-a[i]*px - c[i])/b[i] ){
					d[i] = -1;
				} // end if
			}else if (a[i] == 0.0){
				if ( py > -c[i] ){
					d[i] = 1;
				}else if ( py < -c[i] ){
					d[i] = -1;
				} // end if
			}else if (b[i] == 0.0){
				if ( px > -c[i] ){
					d[i] = 1;
				}else if ( px < -c[i] ){
					d[i] = -1;
				} // end if
			} // end if
//			cout << "d[" << i << "]: " << d[i] << endl;
		} // end for
		if ( (d[0] < 0 || d[1] < 0 || d[2] < 0 ) && d[0]*d[1]*d[2] > 0){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		} // end if 
	
	} // end for
		
	return 0;
}

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

int main(){
  float x1, y1, x2, y2, x3, y3, xp, yp;
  float areasize;
  float areasize_sum, tmp;

  while(cin>>x1){
    cin>>y1;
    cin>>x2; cin>>y2;
    cin>>x3; cin>>y3;
    cin>>xp; cin>>yp;
    areasize=(x2-x1)*(y3-y1)-(y2-y1)*(x3-x1);
    if(areasize<0) areasize*=-1.0f;

    tmp=(x1-xp)*(y2-yp)-(y1-yp)*(x2-xp);
    if(tmp<0) tmp*=-1.0f;
    areasize_sum=tmp;
    tmp=(x2-xp)*(y3-yp)-(y2-yp)*(x3-xp);
    if(tmp<0) tmp*=-1.0f;
    areasize_sum+=tmp;
    tmp=(x3-xp)*(y1-yp)-(y3-yp)*(x1-xp);
    if(tmp<0) tmp*=-1.0f;
    areasize_sum+=tmp;

    if(areasize==areasize_sum) printf("YES\n");
    else printf("NO\n");
  }

  return 0;
}

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

bool judge(double x1, double y1, double x2, double y2, double xp, double yp){
    double vecx = x2 - x1;
    double vecy = y2 - y1;
    double inner = vecx * xp + vecy * yp;
    if (inner > 0 ){
        return true;
    }else{
        return false;
    }
}

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

C++: #include<iostream>
using namespace std;
int main(){
  double a[2],b[2],c[2],m[2][2],inv[2][2],det,ans[2],s,t;
  while(cin >>a[0]>>a[1]>>b[0]>>b[1]>>c[0]>>c[1]>>ans[0]>>ans[1]){
    b[0]-=a[0];
    b[1]-=a[1];
    c[0]-=a[0];
    c[1]-=a[1];
    ans[0]-=a[0];
    ans[1]-=a[1];
    m[0][0] = b[0];
    m[1][0] = c[0];
    m[0][1] = b[1];
    m[1][1] = c[1];
    det = m[0][0]*m[1][1]-m[1][0]*m[0][1];
    inv[0][0] = m[1][1]/det;
    inv[1][0] = -m[1][0]/det;
    inv[0][1] = -m[0][1]/det;
    inv[1][1] = m[0][0]/det;
    s = ans[0]*inv[0][0]+ans[1]*inv[1][0];
    t = ans[0]*inv[0][1]+ans[1]*inv[1][1];
    if(s>0 && t>0 && s+t<1){cout <<"YES\n";}
    else{cout <<"NO\n";}
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
bool judge_Cross(int, int,int,int);

int main() {
	double x1, y1, x2, y2, x3, y3, xp, yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		double pax = x1 - xp;
		double pay = y1 - yp;
		double pbx = x2 - xp;
		double pby = y2 - yp;
		double pcx = x3 - xp;
		double pcy = y3 - yp;

		if ((judge_Cross(pax, pay, pbx, pay) && judge_Cross(pbx, pby, pcx, pcy) && judge_Cross(pax, pay, pcx, pcy)) ||
			!((judge_Cross(pax, pay, pbx, pay) || judge_Cross(pbx, pby, pcx, pcy) || judge_Cross(pax, pay, pcx, pcy)))) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
	}

	return 0;
}

bool judge_Cross(int x1,int y1,int x2,int y2) {
	if (x1 * y2 - x2 * y1 > 0) {
		return true;
	} else {
		return false;
	}
}