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;

class Vector2{
public:
	Vector2(){}
	Vector2( double aX, double aY ) : x( aX ), y( aY ){}

	double cross( Vector2& a ){
		return ( x * a.y ) - ( y * a.x );
	}

	double x;
	double y;
};

int main(){
	Vector2 p0, p1, p2, q;

	while ( cin >> p0.x >> p0.y >> p1.x >> p1.y >> p2.x >> p2.y >> q.x >> q.y ){
		bool isInner = false;
		Vector2 ab( p1.x - p0.x, p1.y - p0.y );
		Vector2 bc( p2.x - p1.x, p2.y - p1.y );
		Vector2 ca( p0.x - p2.x, p0.y - p2.y );
		Vector2 ap( q.x - p0.x, q.y - p0.y );
		Vector2 bp( q.x - p1.x, q.y - p1.y );
		Vector2 cp( q.x - p2.x, q.y - p2.y );

		if( (ab.cross( ap ) > 0 ) &&
			(bc.cross( bp ) > 0 ) &&
			(ca.cross( cp ) > 0 ) ){
			isInner = true;
		}

		cout << ( isInner ? "Yes" : "No" ) << endl;
	}

	return 0;
}

C++: #include <iostream>

struct Vector2D {
	double x, y;

	Vector2D() : x(0.0), y(0.0) {}
	Vector2D(double init_x, double init_y) : x(init_x), y(init_y) {}
	Vector2D& operator-=(const Vector2D& rhs)
	{
		x -= rhs.x;
		y -= rhs.y;
		return *this;
	}
};

Vector2D operator-(const Vector2D& lhs, const Vector2D& rhs)
{
	return Vector2D(lhs) -= rhs;
}

int main()
{
	Vector2D p1, p2, p3, pp;
	while (std::cin >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y >> pp.x >> pp.y) {
		// p3-based vectors
		Vector2D r1(p1 - p3), r2(p2 - p3), rp(pp - p3);

		// rp = a1 * r1 + a2 * r2
		double det = r1.x * r2.y - r2.x * r1.y;
		double a1 = ( r2.y * rp.x - r2.x * rp.y) / det;
		double a2 = (-r1.y * rp.x + r1.x * rp.y) / det;

		if (a1 > 0 && a2 > 0 && a1 + a2 < 1.0) {
			std::cout << "YES" << std::endl;
		} else {
			std::cout << "NO" << std::endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <math.h>

using namespace std;

typedef struct Point {
    double x;
    double y;
} POINT;

double area(Point l, Point m, Point n);

int main() {
    Point a, b, c, p;
    while (cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> p.x >> p.y) {
        //cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> p.x >> p.y;
        //cout << area(a,b,c) << endl;
        double diff = area(a, b, c) - (area(a, b, p) + area(b, c, p) + area(c, a, p));
        //cout << diff << endl;
        if (fabs(diff) < 0.001) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        } 
    }
}

double area(Point l, Point m, Point n) {
    return fabs( (m.x - l.x) * (n.y - l.y)
            - (m.y - l.y) * (n.x - l.x)) * 0.5;
}

C++: #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

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

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

signed main(){
    while(1){
        rep(i, 0, 3) cin >> x[i] >> y[i];
        cin >> xp >> yp;
        if(cin.eof()) break;
        rep(i, 0, 3){
            x[i] -= xp;
            y[i] -= yp;
        }
        bool f = true;
        rep(i, 0, 3){
            if(cross(i, (i + 1) % 3) < 0) f = false; 
        }
        cout << (f ? "YES" : "NO") << endl;
    }
}

C++: #include<iostream>
#include<vector>
int main()
{
	std::vector<bool>result;
	while (true)
	{
		double x1, y1, x2, y2, x3, y3, xp, yp;
		std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;
		if (!std::cin)
		{
			break;
		}
		double k = ((x2 - x3)*(y3 - y1) - (x3 - x1)*(y2 - y3)) / ((x2 - x3)*(yp - y1) - (xp - x1)*(y2 - y3));
		double s = ((x1 - x3)*(yp - y1) - (xp - x1)*(y1 - y3)) / ((x2 - x3)*(yp - y1) - (xp - x1)*(y2 - y3));
		result.push_back(1 < k && 0 < s && s < 1);
	}
	for (auto i : result)
	{
		std::cout << (i ? "YES" : "NO") << std::endl;
	}
	return 0;
}

C++: #include<cstdio>

using namespace std;
 
#define god(x1,y1,x2,y2,x3,y3) x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2)

int main(){
	double x1,y1,x2,y2,x3,y3,ax,ay;

	while(scanf("%lf%lf%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3,&ax,&ay) != EOF){
		if(god(x1,y1,x2,y2,x3,y3) > 0.0 && god(ax,ay,x1,y1,x2,y2) > 0.0 &&
			god(ax,ay,x3,y3,x1,y1) > 0.0 &&  god(ax,ay,x2,y2,x3,y3) > 0.0){
				printf("YES\n");
		}
		else if(god(x1,y1,x2,y2,x3,y3) < 0.0 && god(ax,ay,x1,y1,x2,y2) < 0.0 &&
			god(ax,ay,x3,y3,x1,y1) < 0.0 &&  god(ax,ay,x2,y2,x3,y3) < 0.0){
				printf("YES\n");
		}
		else printf("NO\n");
	}
	return 0;
}

C++: #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;
            }
        }
    }
    
    return;
}

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