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 <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define X real()
#define Y imag()
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using comd = complex<double>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(all(v),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  double a,b,c,d,e,f,xp,yp;
  while(cin >> a >> b >> c >> d >> e >> f >> xp >> yp){
    bool flag = true;
    double acx = c-a,abx = e-a,acy = d-b,aby = f-b,apx = xp-a,apy = yp - b;
    double t,s;
    if(acx == 0){
      s = apx/ abx;
      t = (apy - s * aby)/acy;
    }
    else if(acy == 0){
      s = apy/aby;
      t = (apx - s * abx)/acx;
    }
    else if(abx == 0){
      t = apx / acx;
      s = (apy- t * acy)/aby;
    }
    else if(aby == 0){
      t = apy/acy;
      s = (apx - t * acx)/abx;
    }
    else{
      t = (abx * apy - apx * aby)/(acy - acx*aby);
      s = (apx - t * acx)/abx;
    }
    flag = 0 < t+s && t+s < 1;
    Ans(flag);
  }
  return 0;
}

C++: #include<iostream>

struct Point{
	double x, y;
};
typedef Point Vector;

double ExteriorProduct(Vector v1, Vector v2){
	return v1.x*v2.y-v2.x*v1.y;
}

int Abs(int i){
	return i>0?i:-i;
}


int main(){
	Point ps[3], p;
	while(true){
		for(int i=0;i<3;i++){
			std::cin >> ps[i].x >> ps[i].y;
		}
		if(std::cin.eof())break;

		std::cin >> p.x >> p.y;

		int count = 0;
		for(int i=0;i<3;i++){
			Vector pv, v; //点Pからのベクトル辺のベクトル
			Point first_p = ps[i], second_p = ps[(i+1)%3];
			pv = {p.x-first_p.x, p.y-first_p.y};
			v = {first_p.x-second_p.x, first_p.y-second_p.y};
			if(ExteriorProduct(pv, v) > 0){
				count++;
			}else{
				count--;
			}
		}

		if(Abs(count) == 3){
			std::cout << "YES\n";
		}else{
			std::cout << "NO\n";
		}
	}
	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 == u) printf("YES\n");
    else printf("NO\n");
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<string>
#include<random>
using namespace std;


int main(){

  double x[4], y[4];
  while(cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3]){

    vector<bool> t(3, false);
    for(int i=0; i<3; i++){
      if( ( x[ i ] - x[ (i+1)%3 ] )*( y[ 3 ]-y[ (i+1)%3 ]) - ( y[ i ] - y[ (i+1)%3 ] )*( x[ 3 ] - x[ (i+1)%3 ] ) < 0 ) t[i] = true;
    }

    if( (t[0] && t[1] && t[2])||(!t[0] && !t[1] && !t[2]) ) cout << "YES" << endl;
    else cout << "NO" << endl;

  }

  return 0;
}














// EOF

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>

#define FOR(i, a) for(int i=0;i<(int)a;++i)
typedef long long ll;
typedef long double ld;
using namespace std;

void solver() {
    float x1, x2, x3, xp, y1, y2, y3, yp;
    while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        auto z1 = (x3 - x2) * (yp - y2) - (y3 - y2) * (xp - x2);
        auto z2 = (x1 - x3) * (yp - y3) - (y1 - y3) * (xp - x3);
        auto z3 = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1);
        auto isIn = z1 > 0 && z2 > 0 && z3 > 0;
        if (isIn) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}

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

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

class Point {
public:
    double x, y;
};

double dotProduct(Point p1, Point p2) {
    return p1.x * p2.y - p1.y * p2.x;
}

int main () {
    double x[4], y[4];
    while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3]) {
        bool result = true;
        for (int i = 0; i < 3; i++) {
            Point p[2];
            p[0].x = x[(i+1) % 3] - x[i];
            p[0].y = y[(i+1) % 3] - y[i];
            p[1].x = x[3] - x[i];
            p[1].y = y[3] - y[i];
            if (dotProduct(p[0], p[1]) <= 0) {
                result = false;
                break;
            }
        }
        if (result) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
}