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 <complex>

double x[3], y[3], xp, yp;

#define EPS 0.000001
typedef std::complex<double> P;

double cross(P a, P b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}

bool is_intersected(P a1, P a2, P b1, P b2) 
{
    return ( cross(a2 - a1, b1 - a1) * cross(a2 - a1, b2 - a1) < EPS ) &&
           ( cross(b2 - b1, a1 - b1) * cross(b2 - b1, a2 - b1) < EPS);
}

void solve(void)
{
    P left(-101, yp);
    P right(101, yp);
    bool in_triangle = false;
    if ( ( is_intersected( P(x[0], y[0]), P(x[1], y[1]), left, P(xp, yp) ) ||
           is_intersected( P(x[1], y[1]), P(x[2], y[2]), left, P(xp, yp) ) ||
           is_intersected( P(x[2], y[2]), P(x[0], y[0]), left, P(xp, yp) ) ) &&
         ( is_intersected( P(x[0], y[0]), P(x[1], y[1]), right, P(xp, yp) ) ||
           is_intersected( P(x[1], y[1]), P(x[2], y[2]), right, P(xp, yp) ) ||
           is_intersected( P(x[2], y[2]), P(x[0], y[0]), right, P(xp, yp) ) ) ) {
        in_triangle = true;
    }

   if (in_triangle) {
        std::cout << "YES\n";
    } else {
        std::cout << "NO\n";
    }
}

int main(void)
{
    while (std::cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) {
        solve();
    }
    return 0;
}

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

using namespace std;

int main(){

	int i, m;
	cin >> m;

	for(i=0; i<m; i++){

	int a[3];

	cin >> a[0] >> a[1] >> a[2];
	sort(a, a+3);

	if(a[2]*a[2] == a[0]*a[0] + a[1]*a[1]){
		cout << "YES" << endl;
	}
	else{
		cout << "NO" << endl;
	}
}
}

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++){
			scanf("%lf %lf", &x[i], &y[i]);
		}
		
		double S = T(0, 1, 3) + T(1, 2, 3) + T(2, 0, 3) - T(0, 1, 2);
		
		if (S == 0){
			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 abx, aby, bpx, bpy, bcx, bcy, cpx, cpy, cax, cay, apx, apy, z1, z2, z3;
		abx = x2 - x1; aby = y2 - y1;
		bpx = xp - x2; bpy = yp - y2;
		bcx = x3 - x2; bcy = y3 - y2;
		cpx = xp - x3; cpy = yp - y3;
		cax = x1 - x3; cay = y1 - y3;
		apx = xp - x1; apy = yp - y1;
		z1 = abx*bpy - aby*bpx;
		z2 = bcx*cpy - bcy*cpx;
		z3 = cax*apy - cay*apx;
		if ((z1 > 0 && z2 > 0 && z3 > 0) || (z1 < 0 && z2 < 0 && z3 < 0)) {
			std::cout << "YES" << std::endl;
		}
		else {
			std::cout << "NO" << std::endl;
		}
	}
	return 0;
}

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

bool isin(double a, double b, double c){
	if(a>b) swap(a,b);
	if(b-a<M_PI){
		return (a<c && c<b);
	}
	else{
		return (b<c || c<a);
	}
}

int main(void){

	while(true){

	if(cin.eof()) break;

	complex<double> p[4];
	double a, b, c, d, e, f, g, h;
	cin >> a >> b >> c >> d >> e >> f >> g >> h;
	p[0] = complex<double>(a,b);
	p[1] = complex<double>(c,d);
	p[2] = complex<double>(e,f);
	p[3] = complex<double>(g,h);

	double arg1, arg2, arg3;
	arg1 = arg(p[1]-p[0]);
	arg2 = arg(p[2]-p[0]);
	arg3 = arg(p[3]-p[0]);

	if(arg1<0) arg1+=2*M_PI;
	if(arg2<0) arg2+=2*M_PI;
	if(arg3<0) arg3+=2*M_PI;

	bool b0;
	b0 = isin(arg1, arg2, arg3);

	/////////////////////////

	arg1 = arg(p[0]-p[1]);
	arg2 = arg(p[2]-p[1]);
	arg3 = arg(p[3]-p[1]);

	if(arg1<0) arg1+=2*M_PI;
	if(arg2<0) arg2+=2*M_PI;
	if(arg3<0) arg3+=2*M_PI;

	bool b1;
	b1 = isin(arg1, arg2, arg3);

	/////////////////////////

	arg1 = arg(p[0]-p[2]);
	arg2 = arg(p[1]-p[2]);
	arg3 = arg(p[3]-p[2]);

	if(arg1<0) arg1+=2*M_PI;
	if(arg2<0) arg2+=2*M_PI;
	if(arg3<0) arg3+=2*M_PI;

	bool b2;
	b2 = isin(arg1, arg2, arg3);

	/////////////////////////

	if( b0 && b1 && b2 ) cout << "YES" << endl;
	else cout << "NO" << endl;

	}

	return 0;
}

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

using namespace std;

inline double out(double ax,double ay,double bx,double by){
	return bx * ay - by * ax;
}

int main(void){
	double x1, y1, x2, y2, x3, y3, px, py;
	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&px,&py) != EOF){
		if((out(px - x1,py - y1,x2 - x1,y2 - y1) > 0 && out(px - x2,py - y2,x3 - x2,y3 - y2) > 0 && out(px - x3,py - y3,x1 - x3,y1 - y3) > 0) && (out(px - x1,py - y1,x2 - x1,y2 - y1) < 0 && out(px - x2,py - y2,x3 - x2,y3 - y2) < 0 && out(px - x3,py - y3,x1 - x3,y1 - y3) < 0)){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}

	return 0;
}

C++: #include<iostream>
typedef float f;f a,b,c,d,h,i,e,g;int r(f k,f l,f m,f n){m-=k;n-=l;k=e-k;l=g-l;return m*l-n*k?m*l-n*k>0?1:-1:0;}int main(){for(;!(std::cin>>a>>b>>c>>d>>h>>i>>e>>g).eof();)std::cout<<(r(a,b,c,d)==r(c,d,h,i)==r(h,i,a,b)?"YES\n":"NO\n");}

C++: #include <stdio.h>
using namespace std;
int main(){
double px,py;
double tx[3],ty[3];
bool flag;
bool v[3];
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&tx[0],&ty[0],&tx[1],&ty[1],&tx[2],&ty[2],&px,&py) == 8){
for(int i=0;i<3;i++){
tx[i]=tx[i]-px;
ty[i]=ty[i]-py;
}
for(int i=0;i<3;i++){
if((tx[i%3]*ty[(i+1)%3])-(ty[i%3]*tx[(i+1)%3])<0){
v[i]=true;
}else{
v[i]=false;
}
}
if(v[0]!=v[1]){
cout<<"NO"<<endl;
}else if(v[1]!=v[2]){
cout<<"NO"<<endl;
}else {
cout<<"YES"<<endl;
}
}
return 0;
}

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

double area(complex<double> a, complex<double> b, complex<double> c){
  return (conj(b-a)*(c-a)).imag()/2.0;
}

int main(){
  double x1,y1,x2,y2,x3,y3,xp,yp;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    complex<double> v[3];
    complex<double> vp;

    v[0]=complex<double>(x1,y1);
    v[1]=complex<double>(x2,y2);
    v[2]=complex<double>(x3,y3);
    vp  =complex<double>(xp,yp);

    double s[3];
    for(int j=0;j<3;j++) 
      s[j]=area(vp,v[j],v[(j+1)%3]);

    if(s[0]*s[1]>0 && s[1]*s[2]>0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }

  return 0;
}

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

void fun(float a, float b, float c, float d, float e, float f)
{
    float u,v;
    v = (c*d-a*f)/(b*d-a*e);
    u = (c-b*v)/a;
    if (u>0 && v>0 && (u+v) <=1)
        cout <<"YES"<< endl;
    else
        cout <<"NO"<< endl;
}

int main()
{
    float x1,y1,x2,y2,x3,y3,xp,yp;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
    {
        fun(x2-x1,x3-x1,xp-x1,y2-y1,y3-y1,yp-y1);
    }
   return 0;
}