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 <cmath>
#include <vector>
#include <algorithm>

using namespace std;

double distance(double x1, double y1, double x2, double y2,
                double xp, double yp){
    if(x1 == x2) {
        return abs(xp - x1);
    } else {
        double a = ( y2 - y1 ) / ( x2 - x1 );
        double b = y1 - a * x1;
        return abs(a*xp-yp-b) / sqrt(1+a*a);
    }
}

int main(){
    vector<double> p(6);
    double xp, yp;
    while(cin >> p[0] >> p[1] >> p[2] >> p[3] >> p[4] >> p[5] >> xp >> yp){
        bool yes = true;
        for(int i = 0; i < 3; i++){
            double d1 = distance(p[0], p[1], p[2], p[3], p[4], p[5]);
            double d2 = distance(p[0], p[1], p[2], p[3], xp, yp);
            yes &= (d2 < d1 && d2 > 0);
            rotate(p.begin(), p.begin()+2, p.end());
        }
        cout << (yes ? "YES" : "NO") << endl;
    }
}

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

int main(){
	double x1,y1,x2,y2,x3,y3,xp,yp;
	while(cin>>x1){
		cin>>y1>>x2>>y2>>x3>>y3>>xp>>yp;
		double a1,a2,a3;
		a1=(x2-x1)*(yp-y1)-(y2-y1)*(xp-x1);
		a2=(x3-x2)*(yp-y2)-(y3-y2)*(xp-x2);
		a3=(x1-x3)*(yp-y3)-(y1-y3)*(xp-x3);
		if((a1>0 && a2>0 && a3>0) || (a1<0 && a2<0 && a3<0)){
			cout<<"YES"<<endl;
		}else {
			cout<<"NO"<<endl;
		}
	}
	return 0;
}

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

using  namespace std;

int main() {
	double xa, ya, xb, yb, xc, yc, xp, yp;
	while (cin >> xa >> ya >> xb >> yb >> xc >> yc >> xp >> yp) {
		/*外積で正負で判定する*/
		double one, two, three;
		one = (xc - xp)*(ya - yc) - (yc - yp)*(xa - xc);
		two = (xb - xp)*(yc - yb) - (yb - yp)*(xc - xb);
		three = (xa - xp)*(yb - ya) - (ya - yp)*(xb - xa);
		double t_one = abs(one), t_two = abs(two), t_three = abs(three);
		one = one / t_one;
		two = two / t_two;
		three = three / t_three;
		if (one == two && one == three && two == three) {

			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}

C++: /*problem C*/

#include <iostream>
using namespace std;

typedef struct{
	double x,y;
}point_obj;

int isClossLine(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){
	return ( (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3))*((x1-x2)*(y4-y1)+(y1-y2)*(x1-x4));
}

int main(){
	point_obj p[5];
	int i,j;
	p[3].x=0;
	p[3].y=0;

	while(cin>>p[0].x){
		cin>>p[0].y;

		p[3].x=p[0].x;
		p[3].y=p[0].y;

		for(int i=0;i<3;i++){
			cin>>p[i].x,cin>>p[i].y;

			p[3].x+=p[i].x;
			p[3].y+=p[i].y;
		}
		p[3].x/=3.0;
		p[3].y/=3.0;

		if(isClossLine(p[0].x,p[0].y,p[1].x,p[1].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0 &&
			isClossLine(p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) >0 &&
			isClossLine(p[0].x,p[0].y,p[2].x,p[2].y,p[3].x,p[3].y,p[4].x,p[4].y) > 0){

			cout<<"YES"<<endl;
		}

		else{
			cout<<"NO"<<endl;
		}
	}
	
	
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

double cross (double x1, double x2, double y1, double y2 )
{
	return (x1*y2 - x2*y1 );
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.APT", "r", stdin );
	string str = "";
	while (getline (cin, str ) ){
		stringstream ss (str );
		double x1, y1, x2, y2, x3, y3, xp, yp;
		ss >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
		double c1 = cross (xp - x1, yp - y1 , x2 - x1, y2 - y1 );
		double c2 = cross (xp - x2, yp - y2 , x3 - x2, y3 - y2 );
		double c3 = cross (xp - x3, yp - y3 , x1 - x3, y1 - y3 );
		if ((c1 > 0. && c2 > 0. && c3 > 0. ) || (c1 < 0. && c2 < 0. && c3 < 0. ) ){
			printf ("YES\n" );
		}else{
			printf ("NO\n" );
		} // end if
	} // end while

	return 0;
}