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>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    double x[3], y[3];
    double xp, yp;
    double ax, ay, bx, by;
    while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) {
        string res = "YES";
        for (int i=0; i<3; ++i) {
            ax = x[(i+1)%3] - x[i];
            ay = y[(i+1)%3] - y[i];
            bx = xp - x[i];
            by = yp - y[i];
            if (ax * by - ay * bx < 0) {
                res = "NO";
            }
        }
        cout << res << "\n";
    }
    return 0;
}

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

int main()
{
	double x1, x2, x3, y1, y2, y3, xp, yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
		vector<bool> vec(3, true);
		if (x1 * y2 - y1 * x2 < 0) vec[0] = false;
		if (x2 * y3 - y2 * x3 < 0) vec[1] = false;
		if (x3 * y1 - y3 * x1 < 0) vec[2] = false;
		if (vec[0] * vec[1] * vec[2] || !(vec[0] + vec[1] + vec[2])) cout << "YES\n";
		else cout << "NO\n";
	}
	cout.flush();
}

C++: #include <stdio.h>
int main(){
	float d,e,f,g,h,i,m,n,x;
	for(;~scanf("%f%f%f%f%f%f%f%f",&d,&e,&f,&g,&h,&i,&m,&n);){
		x=(h-f)*(n-g)-(m-f)*(i-g);
		bool ret=x*(f-d)*(n-e)>x*(m-d)*(g-e)&&x*(d-h)*(n-i)>x*(m-h)*(e-i);
		puts(ret?"YES":"NO");
	}
}

C++: #include<iostream>
#include<complex>
using namespace std;
typedef complex<double> xy_t;
double x[4],y[4];
xy_t d[4];
double a[3]; 
double cross_product(xy_t a,xy_t b){
  return (conj(a)*b).imag();
}
int main(){
  while(1){
    for(int i=0;i<4;i++)cin>>x[i]>>y[i];
    for(int i=0;i<4;i++)d[i]=xy_t(x[i],y[i]);
    for(int i=0;i<3;i++){
      a[i]=cross_product(d[3]-d[i],d[3]-d[(i+1)%3]);
    }
    if(a[0]<0&&a[1]<0&&a[2]<0){
      cout<<"YES"<<endl;
    }else if(a[0]>0&&a[1]>0&&a[2]>0){
      cout<<"YES"<<endl;
    }else{
      cout<<"NO"<<endl;
    }
  }
}

C++: #include <stdio.h>

int main(void) {

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

  while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF) {

    double s,t;

    s=(double)((y3-y1)*(xp-x1)-(x3-x1)*(yp-y1))/(double)((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1));

    t=(double)((x2-x1)*(yp-y1)-(xp-x1)*(y2-y1))/(double)((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1));

    if(s>0 && t>0 && s+t<1) {
      //printf("%lf %lf",s,t);
      printf("YES\n");

    } else {
      //printf("%lf %lf",s,t);      
      printf("NO\n");

    }
       
  }
   
  return 0;

}

C++: #include<iostream>
using namespace std;
int main()
{
double x;
double x1,y1,x2,y2,x3,y3,xp,yp;
int S=0;
while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
{
	if(y1<y2&&y3<y2)
	{
	for(double i=x1;i<=x3;i+=0.0001)
{
x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)>(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)>(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)<(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
	S++;
cout<<"YES"<<endl;
break;	
}
}
}
else if(y1>y2&&y1>y1)
{
for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-((y1-y2)/(x1-x2)*x1)>(y1-y2)/(x1-x2)*xp+y1-((y1-y2)/(x1-x2)*x1)&&(y2-y3)/(x2-x3)*x+y2-((y2-y3)/(x2-x3)*x2)<(y2-y3)/(x2-x3)*xp+y2-((y2-y3)/(x2-x3)*x2)&&(y1-y3)/(x1-x3)*x+y1-((y1-y3)/(x1-x3)*x2)>(y1-y3)/(x1-x3)*xp+y1-((y1-y3)/(x1-x3)*x1))
{
	S++;
cout<<"YES"<<endl;
break;	
	}	
	}	
}
else if(y3>y1&&y3>y2)
{
	for(double i=x1;i<=x3;i+=0.0001)
{x=i;
if((y1-y2)/(x1-x2)*x+y1-(y1-y2)/(x1-x2)*x1<(y1-y2)/(x1-x2)*xp+y1-(y1-y2)/(x1-x2)*x1&&(y2-y3)/(x2-x3)*x+y2-(y2-y3)/(x2-x3)*x2>(y2-y3)/(x2-x3)*xp+y2-(y2-y3)/(x2-x3)*x2&&(y1-y3)/(x1-x3)*x+y1-(y1-y3)/(x1-x3)*x2>(y1-y3)/(x1-x3)*xp+y1-(y1-y3)/(x1-x3)*x1)
{
	S++;
cout<<"YES"<<endl;
break;
}
}
}

{
if(S<1)
{
 	cout<<"NO"<<endl;
 }
}
}
return 0;
}

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

using namespace std;

struct L{
    L(double xa, double ya, double xb, double yb){
	if(xa > xb)swap(xa, xb), swap(ya, yb);
	x1 = xa;
	y1 = ya;
	x2 = xb;
	y2 = yb;
	if(xa-xb == 0){
	    a = 1;
	    b = 0;
	    c = -xa;
	}
	else {
	    a = (ya-yb);
	    b = (xb- xa);
	    c = -(a*xa + b*ya);
	}
    };
    double f(double x, double y){
	return a*x + b*y + c;
    }
    double a, b, c, x1, x2, y1, y2;//0 = ax + by + c [x1, x2]
};

bool cross(L a, L b){
    return (a.f(b.x1, b.y1) * a.f(b.x2, b.y2) < 0 && 
	    b.f(a.x1, a.y1) * b.f(a.x2, a.y2) < 0);
}

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

int main(){
    while(cin){
	cin >> x1 >> y1 >> x2 >> y2>> x3 >> y3 >> xp >> yp;
	L a = L(x1, y1, x2, y2);
	L b = L(x1, y1, x3, y3);
	L c = L(x2, y2, x3, y3);
	L p = L(xp, yp, 101, 101);
	int res = 0;
	if(cross(a,p))res++;
	if(cross(b,p))res++;
	if(cross(c,p))res++;
	if(res % 2 == 0)cout << "NO" <<  endl;
	else cout << "YES"<<endl;}
    return 0;
}

C++: //
//  practise.h
//  c++practise
//
//  Created by Ubnit04 on 2015/06/10.
//
//

#include <iostream>
#include <math.h>

using namespace std;

float getSquare(float x1, float y1, float x2, float y2, float x3, float y3)
{
    float xAB, yAB;
    float xBC, yBC;

    xAB = x2 - x1;
    yAB = y2 - y1;

    xBC = x3 - x2;
    yBC = y3 - y2;
    
    return fabs((xAB * yBC - yAB * xBC) / 2.0f); //square of tri-angle
    
}

void isIn()
{
    float x1, y1;
    float x2, y2;
    float x3, y3;
    float xp, yp;
    
    float sABC, sABP, sACP, sBCP;
    
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp)
    {
        sABC = getSquare(x1, y1, x2, y2, x3, y3);
        sABP = getSquare(x1, y1, x2, y2, xp, yp);
        sBCP = getSquare(x2, y2, x3, y3, xp, yp);
        sACP = getSquare(x1, y1, x3, y3, xp, yp);
        
        if((sABC > 0) && (sBCP > 0) && (sACP > 0))
        {
            if (sABC == sABP + sACP + sBCP) //if p is including triangle this should be worked
            {
                cout<<"YES"<<endl;
            }
            else if (sABC < sABP + sACP + sBCP)
            {
                cout<<"NO"<<endl;
            }
        }
        else
        {
            return;
        }
    }
    
    return;
}

int main()
{
    isIn();
    return 0;
}