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 <stdio.h>
#include <math.h>

using namespace std;


int main(){
	double x1,x2,x3,y1,y2,y3,xp,yp;
	double dist1,dist2,dist3,p_dist1,p_dist2,p_dist3;

	while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
		//(x3,y3)????????¢:(y2-y1)*x+(x1-x2)*y+(y1*(x2-x1)-x1*(y2-y1))
		//(x1,y1)????????¢:(y2-y3)*x+(x3-x2)*y+(y3*(x2-x3)-x3*(y2-y3))
		//(x2,y2)????????¢:(y3-y1)*x+(x1-x3)*y+(y1*(x3-x1)-x1*(y3-y1));
		dist1 = fabs((y2-y3)*x1+(x3-x2)*y1+(y3*(x2-x3)-x3*(y2-y3)))/sqrt((y2-y3)*(y2-y3)+(x3-x2)*(x3-x2));
		dist2 = fabs((y3-y1)*x2+(x1-x3)*y2+(y1*(x3-x1)-x1*(y3-y1)))/sqrt((y3-y1)*(y3-y1)+(x1-x3)*(x1-x3));
		dist3 = fabs((y2-y1)*x3+(x1-x2)*y3+(y1*(x2-x1)-x1*(y2-y1)))/sqrt((y2-y1)*(y2-y1)+(x1-x2)*(x1-x2));

		p_dist1 = fabs((y2-y3)*xp+(x3-x2)*yp+(y3*(x2-x3)-x3*(y2-y3)))/sqrt((y2-y3)*(y2-y3)+(x3-x2)*(x3-x2));
		p_dist2 = fabs((y3-y1)*xp+(x1-x3)*yp+(y1*(x3-x1)-x1*(y3-y1)))/sqrt((y3-y1)*(y3-y1)+(x1-x3)*(x1-x3));
		p_dist3 = fabs((y2-y1)*xp+(x1-x2)*yp+(y1*(x2-x1)-x1*(y2-y1)))/sqrt((y2-y1)*(y2-y1)+(x1-x2)*(x1-x2));

		if(p_dist1 < dist1 && p_dist2 < dist2 && p_dist3 < dist3){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
    return 0;
}

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

int edinton(int i,int j, int k);
double cross(double *a,double *b);

int main(){
    double p[4][2],z,vec[3][2],cent[3][2];
    bool tr;
    int add,sum;
    while(1){
        for(int i=0;i<4;i++){
            cin >> p[i][0] >> p[i][1];
        }
        add = 1;
        sum = 0;
        tr=false;
        for(int i=0;i<3;i++){
            if(i>=2) add = -2;
            vec[i][0]=p[i+add][0]-p[i][0];
            vec[i][1]=p[i+add][1]-p[i][1];
            cent[i][0] = p[3][0]-p[i+add][0];
            cent[i][1] = p[3][1]-p[i+add][1];
        }
        for(int i=0;i<3;i++){
            z=vec[i][0]*cent[i][1]-vec[i][1]*cent[i][0];
            sum+=z/fabs(z);
            if(z==0) tr = true;
        }
        if(sum == 3||sum == -3||tr) cout << "YES" << endl;
        else{
            cout << "NO" << endl;
            break;
        }
    }
    return 0;
}

C++: #include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>

using namespace std;

double EPS = 1e-10;

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  point operator * (double d){
    return point(x*d,y*d);
  }
};

double dot(point a, point b) {
  return (a.x * b.x + a.y * b.y);
}

double cross(point a, point b) {
  return (a.x * b.y - a.y * b.x);
}

int is_point_on_line(point a, point b, point c) {
  return cross(b-a, c-a)==0.0 &&
         (dot(b-a, c-a) > -EPS) &&
         (dot(a-b, c-b) > -EPS);
}

int is_intersected_ls(point a1, point a2, point b1, point b2) {

  if(cross(a1-a2,b1-b2)==0){
    return is_point_on_line(a1,a2,b1) || is_point_on_line(a1,a2,b2) 
        || is_point_on_line(b1,b2,a1) || is_point_on_line(b1,b2,a2);
  }
  else {
    return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) &&
           ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS );
  }
}

int inside(point p, vector<point> ps){
  point a,b;
  a=b=p;

  b.x=1000000;

  int n=ps.size();
  ps.push_back(ps[0]);

  for(int i=0;i<n;i++){
    if(is_point_on_line(ps[i],ps[i+1],p))return 0;
  }
  
  int cnt1=0;
  for(int i=0;i<n;i++)
    if(is_point_on_line(a,b,ps[i]))cnt1++;
  
  int cnt=0;
  for(int i=0;i<n;i++)
    if(is_intersected_ls(ps[i],ps[i+1],a,b))cnt++;
  
  return (cnt-cnt1)%2;
}

int main(void){
 
  point in[4],p;
  vector<point>ps;

  while(cin>>in[1].x>>in[1].y>>in[2].x>>in[2].y>>in[3].x>>in[3].y>>p.x>>p.y){

    ps.clear();

    for(int i=1;i<4;i++)
    ps.push_back(in[i]);

    if(inside(p,ps))cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0;
}

C++: 
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
typedef vector<int> VI;
#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )

template <typename T>
double angle(pair<T, T> a, pair<T, T> b) {
    double costheta = (a.first*b.first + a.second*b.second)/(sqrt(a.first*a.first+a.second*a.second)*sqrt(b.first*b.first+b.second*b.second));
    double ang = acos(costheta);
    while (ang >= 2*M_PI) {
        ang -= 2*M_PI;
    }
    if (ang < 0)    ang = -ang;
    return ang;
}

template <typename T>
double norm(pair<T, T> a) {
    return sqrt(a.first*a.first + a.second*a.second);
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    vector<string> anslist;

    double x1, y1, x2, y2, x3, y3, xp, yp;
    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        pair<double, double> a, b, p;
        a.first = x2 - x1;
        a.second = y2 - y1;
        b.first = x3 - x1;
        b.second = y3 - y1;
        p.first = xp - x1;
        p.second = yp - y1;
        double theta = angle(a, b);
        double phi = angle(a, p);
        double psi = angle(b, p);
        
        if (norm(p) > norm(a) || norm(p) > norm(b)) {
            anslist.push_back("NO");
            break;
        }
        if (phi > theta || psi > theta) {
            anslist.push_back("NO");
            break;
        }
        anslist.push_back("YES");
    }

    for(auto ans : anslist) {
        cout << ans << endl;
    }

    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)n; i++)
#define PI 3.14159265358979323846
#define vll vector<long long>
#define vvll vector<vector<long long>>
#define pll pair<long long, long long>
#define cld complex<long double>
using namespace std;
using ll = long long;
using ld = long double;

// ----本問について----
// 問題：A Point in a Triangle
// 問題文URL：https://onlinejudge.u-aizu.ac.jp/problems/0012
// 所要時間：
// 学んだこと：
// ------------------

// ----ここから本問のソースコード----

// グローバル変数（入力）
complex<ld> c[3], cp;

void input() {
  rep(i, 3) {
    ld x, y;
    cin >> x >> y;
    c[i] = complex<ld>(x, y);
  }
  ld xp, yp;
  cin >> xp >> yp;
  cp = complex<ld>(xp, yp);
}

ld cross_product(complex<ld> a, complex<ld> b) { return (conj(a) * b).imag(); }

void solve() {
  rep(i, 3) { c[i] -= cp;}
  ld a[3];
  rep(i, 3) { a[i] = cross_product(c[i % 3], c[(i + 1) % 3]);}
  if ((a[0] > 0 && a[1] > 0 && a[2] > 0) ||
      (a[0] < 0 && a[1] < 0 && a[2] < 0)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

int main() {
  while (true) {
    input();
    if (!cin) { break; }
    solve();
  }
  return 0;
}