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>

struct Vec2D{
				double x,y;
};

Vec2D vector(double x1,double y1,double x2,double y2){
				Vec2D vec;
				vec.x = x2 -x1;
				vec.y = y2 -y1;
				return vec;
}

double outerProduct(Vec2D a,Vec2D b){
				double crossProduct = a.x * b.y - a.y * b.x;
				return crossProduct;
}

int main(int argc, char *argv[])
{
	double x1,x2,x3,y1,y2,y3,x,y;

	while(std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x >> y){

		Vec2D BA = vector(x2,y2,x1,y1);
		Vec2D CB = vector(x3,y3,x2,y2);
		Vec2D AC = vector(x1,y1,x3,y3);


		Vec2D BP = vector(x2,y2,x,y);
		Vec2D CP = vector(x3,y3,x,y);
		Vec2D AP = vector(x1,y1,x,y);

		double a,b,c;

		a = outerProduct(BA,BP);
		b = outerProduct(CB,CP);
		c = outerProduct(AC,AP);



		if(a<0 && b<0 && c<0){
					std::cout << "YES" << std::endl;
		}else{
					std::cout << "NO" << std::endl;
		}

	}
}

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

int main(){
	double x[3],y[3],xp,yp;
	while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp){
		bool ans=true;
		cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp;
		//???????????¨????????????
		double gaiseki[3];	//gaiseki[i]???????????????P0P1??¨????????????P0Q????????????z??§?¨?
		for(int i=0;i<3;i++){
			int k = (i+1)%3;
			double vx,vy,vpx,vpy;
			vx = x[k]-x[i];
			vy = y[k]-y[i];
			vpx = xp-x[i];
			vpy = yp-y[i];
			gaiseki[i] = vx*vpy-vy*vpx;
			if(gaiseki[i]<=0) ans = false;
		}
		if(ans){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

double cross(complex<double> A, complex<double> B){
	return (conj(A)*B).imag();
}

int main(){
	complex<double> Points[3], P;
	while(true){
		double x,y;
		for(int i=0;i<3;i++){
			cin >> x >> y;
			Points[i]={x,y};
		}

		cin >> x >> y;
		P={x,y};

		if(!cin)break;

		int sum=0;
		for(int i=0;i<3;i++){
			sum += cross((Points[(i+1)%3]-Points[i]), (P-Points[i])) > 0;
		}
		cout << (sum==0||sum==3 ? "Yes":"No") << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
double x[4],y[4],px,py,ax,ay,bx,by;
int main()
{
	while(true)
	{
		for(int i = 1;i<=3;i++){cin >> x[i];cin >> y[i];}
		if(cin.eof()){break;}
		cin >> px;
		cin >> py;
		double m,n;
		ax = x[2]-x[1];
		ay = y[2]-y[1];
		bx = x[3]-x[1];
		by = y[3]-y[1];
		px = px - x[1];
		py = py - y[1];
		double det = ax*by-ay*bx;
		m = (by*px-bx*py)/det;
		n = (-ay*px+ax*py)/det;
		if( det ==0) cout << "NO"<<endl;
		if(m>0 && m <= 1 && n > 0 && n <= 1 && m+n <= 1 ) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	float x[3], y[3], xp, yp;
	float sM, s1, s2, s3;
	
	while (scanf("%f %f %f %f %f %f %f %f", &x[0], &y[0], &x[1], &y[1], &x[2], &y[2], &xp, &yp) != EOF){
		
		sM = ((x[1] - x[0]) * (y[2] - y[0]) - (x[2] - x[0]) * (y[1] - y[0])) / 2;
		if (sM < 0){
			sM *= -1;
		}
		
		s1 = ((xp - x[2]) * (y[1] - y[2]) - (x[1] - x[2]) * (yp - y[2])) / 2;
		if (s1 < 0){
			s1 *= -1;
		}
		
		s2 = ((xp - x[1]) * (y[0] - y[1]) - (x[0] - x[1]) * (yp - y[1])) / 2;
		if (s2 < 0){
			s2 *= -1;
		}
		
		s3 = ((xp - x[0]) * (y[2] - y[0]) - (x[2] - x[0]) * (yp - y[0])) / 2;
		if (s3 < 0){
			s3 *= -1;
		}
		
		if (sM == s1 + s2 + s3){
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	
	return (0);
}

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

int main(){
double x1;
double y1;
double x2;
double y2;
double x3;
double y3;
double xp;
double yp;
while(cin >> x1){
cin >> y1;
cin >> x2;
cin >> y2;
cin >> x3;
cin >> y3;
cin >> xp;
cin >> yp;
double x4;
double x5;
double x6;
double x7;
double x8;
int a;
a=0;

x4=(y2-y1)*(x3-xp)-(y3-yp)*(x2-x1);
x7=y2*x1-x2*y1;
x8=y3*xp-x3*yp;
x5=x7*(x3-xp)-x8*(x2-x1);
x6=x5/x4;

if((x2-x6)*(x6-x1)>0){a=a+1;}
if((x3-xp)*(xp-x6)>0){a=a+1;}
if(a==2){cout <<"YES"<<endl;}
if(a!=2){cout <<"NO"<<endl;}

}

}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
	double a[2],b[2],c[2],p[2];
	double matrix[2][2],ans[2],reverse[2][2],det,x,y;
	while(cin >>a[0]>>a[1]>>b[0]>>b[1]>>c[0]>>c[1]>>p[0]>>p[1]){
		b[0] = b[0]-a[0];
		b[1] = b[1]-a[1];
		c[0] = c[0]-a[0];
		c[1] = c[1]-a[1];
		p[0] = p[0]-a[0];
		p[1] = p[1]-a[1];
		matrix[0][0] = b[0];
		matrix[1][0] = c[0];
		matrix[0][1] = b[1];
		matrix[1][1] = c[1];
		ans[0] = p[0];
		ans[1] = p[1];
		det = matrix[0][0]*matrix[1][1]-matrix[0][1]*matrix[1][0];
		reverse[0][0] = matrix[1][1]/det;
		reverse[1][0] = -matrix[1][0]/det;
		reverse[0][1] = -matrix[0][1]/det;
		reverse[1][1] = matrix[0][0]/det;
		x = ans[0]*reverse[0][0]+ans[1]*reverse[1][0];
		y = ans[0]*reverse[0][1]+ans[1]*reverse[1][1];
		if(x>0 && y>0 && x+y<1){cout <<"YES"<<endl;}
		else{cout <<"NO"<<endl;}
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

double x[4], y[4];

double l(int a, int b)
{
	return sqrt((y[a] - y[b]) * (y[a] - y[b]) + (x[a] - x[b]) * (x[a] - x[b]));
}

double T(int a, int b, int c)
{
	double A = l(a, b);
	double B = l(b, c);
	double C = l(c, a);
	double s = (A + B + C) / 2;
	return sqrt(s * (s - A) * (s - B) * (s - C));
}

int main()
{
	while (true){
		for (int i = 0; i < 4; i++){
			if (scanf("%lf %lf", &x[i], &y[i]) == EOF) return 0;
		}
		
		double S = T(0, 1, 3) + T(1, 2, 3) + T(2, 0, 3) - T(0, 1, 2);
		//printf("%.50lf\n", (double)S);
		if (S > (double)0.0){
			puts("NO");
		}
		else {
			puts("YES");
		}
	}
	
	return 0;
}