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<cstdio>
#include<cmath>
#define EPS 1e-10
using namespace std;

int main(){
  double x1,x2,x3,xp,y1,y2,y3,yp;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    double A = sqrt(pow(x1-x2,2)+pow(y1-y2,2)),B = sqrt(pow(x2-x3,2)+pow(y2-y3,2)), C = sqrt(pow(x1-x3,2)+pow(y1-y3,2)) ;
    double s = (A+B+C)/2.0;
    double S = sqrt(s*(s-A)*(s-B)*(s-C));
 
   double A12 = sqrt(pow(x1-x2,2)+pow(y1-y2,2)),B1p =sqrt(pow(x1-xp,2)+pow(y1-yp,2)), C2p = sqrt(pow(xp-x2,2)+pow(yp-y2,2)) ;
    double s2 = (A12+B1p+C2p)/2.0;
    double S2 = sqrt(s2*(s2-A12)*(s2-B1p)*(s2-C2p));
    /*
    if(S2 == 0){
      cout << "NO" << endl;
      break;
    }
    */
    double A13 = sqrt(pow(x1-x3,2)+pow(y1-y3,2)), Cp3 = sqrt(pow(xp-x3,2)+pow(yp-y3,2));
    double s3 = (A13+B1p+Cp3)/2.0;
    double S3 =  sqrt(s3*(s3-A13)*(s3-B1p)*(s3-Cp3));
    /*
    if(s3 == 0){
      cout << "NO" << endl;
      break;
    }
    */
    double A23 = sqrt(pow(x3-x2,2)+pow(y3-y2,2));
    double s4 = (A23+C2p+Cp3)/2.0;
    double S4 =  sqrt(s4*(s4-A23)*(s4-C2p)*(s4-Cp3));
    /*
    if(S3 == 0){
      cout << "NO" << endl;
      break;
    }
    */
    double Ssum = S2+S3+S4;
    
    fabs(Ssum - S)< 0.00001?cout << "YES" << endl:cout << "NO" << endl;


  }
  return 0;
}

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;
}
//t[i]→t[i+1]のベクトルに対してt[i]→(px,py)のベクトルが同じ方向を向いているかを判定する
//t[i]を90度回転させたベクトルとの内積で求める
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 <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <complex>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;

#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class T> void preview(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}

const int INF = 100000000;
const double PI = acos(-1.0), EPS = 1e-10;

double crp(double x1, double y1, double x2, double y2) {
	return x1 * y2 - y1 * x2;
}

double vabs(double x, double y) {
	return sqrt(x * x + y * y);
}

int main() {
	for(double x1, y1, x2, y2, x3, y3, xp, yp; cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp;) {
		x1 -= xp;
		x2 -= xp;
		x3 -= xp;

		y1 -= yp;
		y2 -= yp;
		y3 -= yp;

		double v1 = vabs(x1, y1);
		double v2 = vabs(x2, y2);
		double v3 = vabs(x3, y3);

		double rad_a = crp(x1, y1, x2, y2) / (v1 * v2);
		double rad_b = crp(x2, y2, x3, y3) / (v2 * v3);
		double rad_c = crp(x3, y3, x1, y1) / (v3 * v1);

		if(rad_a >= 0.0 && rad_b >= 0.0 && rad_c >= 0.0) puts("YES");
		else puts("NO");
	}
	return 0;
}

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) {
    int s, t, u;
    x1 -= xp, x2 -= xp, x3 -= xp;
    y1 -= yp, y2 -= yp, y3 -= yp;
    //printf("%f %f %f %f %f %f\n", x1, y1, x2, y2, x3, y3);
    s = x1 * y2 - x2 * y1;
    if(!s) {
      printf("NO\n");
      continue;
    }
    s = s < 0 ? 0 : 1;
    t = x2 * y3 - x3 * y2;
    if(!t) {
      printf("NO\n");
      continue;
    }
    t = t < 0 ? 0 : 1;
    u = x3 * y1 - x1 * y3;
    if(!u) {
      printf("NO\n");
      continue;
    }
    u = u < 0 ? 0 : 1;
    //printf("%d %d %d\n", s, t, u);
    if(!s^t && !t^s) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>

using namespace std;


double f(double x1, double y1, double x2, double y2, double x3, double y3){
	x2 -= x1;
	x3 -= x1;
	y2 -= y1;
	y3 -= y1;
	return abs(x2*y3-y2*x3)/2;
}

bool solve(){
	vector<double> x(4),y(4);
	while(cin>>x[0]){
		cin>> y[0];
		for(int i=1;i<4;i++){
			cin>> x[i]>> y[i];
		}
		double s[4];
		for(int i=0;i<4;i++){
			s[i] = f(x[i],y[i],x[(i+1)%4],y[(i+1)%4],x[(i+2)%4],y[(i+2)%4]);
		}
		if(s[0] == s[1]+s[2]+s[3]){
			cout<< "YES"<< endl;
		}else{
			cout<< "NO"<< endl;
		}
	}
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

C++: #include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
using namespace std;
typedef long long Int;
#define REP(i , x) for(int i = 0 ; i < x ; ++i)

typedef pair<int, int> P;


struct point{
	double x, y;
};

bool Func(point p1,point p2,point p3)
{
	double x1 = p2.x - p1.x;
	double y1 = p2.y - p1.y;
	double x2 = p3.x - p2.x;
	double y2 = p3.y - p2.y;

	return (x1*y2 - x2*y1) > 0;
}

int main()
{
	point p1, p2, p3, p4;
	while (cin >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y >> p4.x >> p4.y){

		string ans = Func(p1, p2, p4) && Func(p2, p3, p4) && Func(p3, p1, p4) ? "YES" : "NO";

		cout << ans << 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;
            V[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;
}