Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include <bits/stdc++.h>
#include <chrono>
using namespace std;

using _i64 = int64_t;
using _u64 = uint64_t;
using _f64 = double;

#define endl "\n"

#define _for(i, start, end) for(_i64 i = (_i64)start; i < (_i64)end; ++i)
#define _rep(i, number) _for(i, 0, number)
#define _foreach(e, data) for(auto& e : data)
#define _all(data) data.begin(), data.end()

template<typename type>
_i64 _size(const type& data) { return static_cast<_i64>(data.size()); }
template<typename type, size_t size>
_i64 _size(const type (&)[size]) { return static_cast<_i64>(size); }

enum _flag : bool { able = true, disable = false };

struct _time {
    _time(_flag flag) { check = flag; if(!check) { return; } gettime(start); }
    ~_time() {
        if(!check) { return; }; gettime(end);
        _i64 elapse = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cout << endl << "Time: " << elapse << " ms" << endl;
    }
    private:
    using _timer = chrono::time_point<chrono::system_clock>;
    _timer start, end; bool check;
    void gettime(_timer& time) { time = chrono::system_clock::now(); }
};

struct _ini { _ini() { ios::sync_with_stdio(false); cin.tie(nullptr); } } _ini;

struct _vector2 {
    _f64 x, y;
    _vector2 operator+(const _vector2& rhs) const {
        _vector2 temp;
        temp.x = x + rhs.x; temp.y = y + rhs.y;
        return temp;
    }
    _vector2 operator-(const _vector2& rhs) const {
        _vector2 temp;
        temp.x = x - rhs.x; temp.y = y - rhs.y;
        return temp;
    }
};

int main() {
    {
        _time time(disable);
        _vector2 OA, OB, OC, OP, AP, BP, CP; bool ans1, ans2;
        auto outer2 = [](_vector2 v1, _vector2 v2) -> _f64 { return v1.x * v2.y - v1.y * v2.x; };
        while(cin >> OA.x >> OA.y >> OB.x >> OB.y >> OC.x >> OC.y >> OP.x >> OP.y) {
            AP = OP - OA; BP = OP - OB; CP = OP - OC;
            ans1 = outer2(AP, BP) > 0 && outer2(BP, CP) > 0 && outer2(CP, AP) > 0;
            ans2 = outer2(AP, BP) < 0 && outer2(BP, CP) < 0 && outer2(CP, AP) < 0;
            cout << (ans1 || ans2 ? "YES" : "NO") << endl;
        }
    }
    return 0;
}

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

typedef complex<double> P;

int main(void){
  double x1, x2, x3, y1, y2, y3, xp, yp;
  while(cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp){
    P a1(x1 - x3, y1 - y3), b1(x2 - x3, y2 - y3), c1(xp - x3, yp - y3);
    P a2(x1 - x2, y2 - y2), b2(x3 - x2, y3 - y2), c2(xp - x2, yp - y2);
    P a3(x3 - x1, y3 - y1), b3(x2 - x1, y2 - y1), c3(xp - x1, yp - y1);
    
    double area11, area12, area21, area22, area31, area32;
    area11 = (a1 * conj(c1)).imag();
    area12 = (b1 * conj(c1)).imag();
    area21 = (a2 * conj(c2)).imag();
    area22 = (b2 * conj(c2)).imag();
    area31 = (a3 * conj(c3)).imag();
    area32 = (b3 * conj(c3)).imag();

    if(((area11 > 0 && area12 < 0) || (area11 < 0  && area12 > 0))
        && ((area21 > 0 && area22 < 0) || (area21 < 0 && area22 > 0))
        && ((area31 > 0 && area32 < 0) || (area31 < 0 && area32 > 0))){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
  }
  return 0;
}

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

constexpr double pi = 3.14159265358979323846;

struct vec2d
{
    double x, y;

    double dot(vec2d const & other)
    {
        return x * other.x + y * other.y;
    }

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

int main()
{
    double x1, y1, x2, y2, x3, y3, xp, yp;
    vec2d v1p, v2p, v3p;
    vec2d v12, v23, v31;
    double a121p, a232p, a313p;
    vec2d v32, v21, v13;
    double a323p, a212p, a131p;

    while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
        v1p = vec2d{xp - x1, yp - y1};
        v2p = vec2d{xp - x2, yp - y2};
        v3p = vec2d{xp - x3, yp - y3};

        v12 = vec2d{x2 - x1, y2 - y1};
        v23 = vec2d{x3 - x2, y3 - y2};
        v31 = vec2d{x1 - x3, y1 - y3};

        v32 = vec2d{x2 - x3, y2 - y3};
        v21 = vec2d{x1 - x2, y1 - y2};
        v13 = vec2d{x3 - x1, y3 - y1};

        a121p = acos(v12.dot(v1p) / (v12.norm() * v1p.norm()));
        a232p = acos(v23.dot(v2p) / (v23.norm() * v2p.norm()));
        a313p = acos(v31.dot(v3p) / (v31.norm() * v3p.norm()));

        a323p = acos(v32.dot(v3p) / (v32.norm() * v3p.norm()));
        a212p = acos(v21.dot(v2p) / (v21.norm() * v2p.norm()));
        a131p = acos(v13.dot(v1p) / (v13.norm() * v1p.norm()));

        if (a121p <= pi / 2 && a232p <= pi / 2 && a313p <= pi / 2 && a323p <= pi / 2 && a212p <= pi / 2 && a131p <= pi / 2) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

    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] ) cout << "YES" << endl;
    else cout << "NO" << endl;

  }

  return 0;
}














// EOF

C++: #include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<stdio.h>
using namespace std;

int main()
{
   double x1,x2,x3,y1,y2,y3,xp,yp;
    double gaiseki1,gaiseki2,gaiseki3;
 
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)!=EOF){
        gaiseki1 = (x2-x1)*(yp-y1)-(y2-y1)*(xp-x1);//全部右or全部左ならok
        gaiseki2 = (x3-x2)*(yp-y2)-(y3-y2)*(xp-x2);
        gaiseki3 = (x1-x3)*(yp-y3)-(y1-y3)*(xp-x3);
 
        if((gaiseki1>0&&gaiseki2>0&&gaiseki3>0) || (gaiseki1<0&&gaiseki2<0&&gaiseki3<0)){
            printf("YES\n");
        }else{
            printf("NO\n");
        }
    }
    return 0;
}

C++: #include <cstdio>
#include <algorithm>
#include <complex>
using namespace std;

int main() {
  for(int tci = 0; ; tci++) {
    double x1,y1,x2,y2,x3,y3,xp,yp;
    if(scanf("%lf%lf%lf%lf%lf%lf%lf%lf", &x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp)<8) break;
    complex<double> ps[3];
    ps[0] = complex<double>(x1,y1);
    ps[1] = complex<double>(x2,y2);
    ps[2] = complex<double>(x3,y3);
    complex<double> pp(xp,yp);
    bool ok = true;
    for(int i = 0; i < 3; i++) {
      complex<double> v0 = ps[(i+1)%3]-ps[i];
      complex<double> v1 = ps[(i+2)%3]-ps[i];
      complex<double> vp = pp-ps[i];
      double det1 = (v0*conj(v1)).imag();
      double det2 = (v0*conj(vp)).imag();
      ok = ok & (det1 * det2 > 1e-9);
    }
    printf("%s\n", ok ? "YES" : "NO");
  }
  return 0;
}